Skip to content

Commit 63b4789

Browse files
authored
Update README.md for lazy loading RDT
1 parent 69dcb4b commit 63b4789

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,12 @@ npm install remix-development-tools
4444
2. Add the following to your application `root.tsx` file:
4545

4646
```diff
47+
+ import { lazy } from "react";
4748
+ import rdtStylesheet from "remix-development-tools/stylesheet.css";
48-
+ import { RemixDevTools } from "remix-development-tools";
49+
+ const RemixDevTools = lazy(() => import("remix-development-tools");
4950

5051
+ export const links: LinksFunction = () => [
51-
+ ...(rdtStylesheet ? [{ rel: "stylesheet", href: rdtStylesheet }] : []),
52+
+ ...(rdtStylesheet && process.env.NODE_ENV === "development" ? [{ rel: "stylesheet", href: rdtStylesheet }] : []),
5253
+ ];
5354

5455

@@ -68,7 +69,7 @@ export default function App() {
6869
<ScrollRestoration />
6970
<Scripts />
7071
<LiveReload />
71-
+ <RemixDevTools />
72+
+ {process.env.NODE_ENV === "development" && <RemixDevTools />}
7273
</body>
7374
</html>
7475
);

0 commit comments

Comments
 (0)