Skip to content

Commit

Permalink
refactor(react): add milliseconds abbreviation (ms) to timeout option
Browse files Browse the repository at this point in the history
  • Loading branch information
pcattori committed Jan 23, 2023
1 parent 90b64b0 commit 040b509
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/remix-react/__tests__/components-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ describe("<LiveReload />", () => {

it("timeout of reload is set to 200ms", () => {
LiveReload = require("../components").LiveReload;
let { container } = render(<LiveReload timeout={200} />);
let { container } = render(<LiveReload timeoutMs={200} />);
expect(container.querySelector("script")).toHaveTextContent(
"setTimeout( () => remixLiveReloadConnect({ onOpen: () => window.location.reload(), }), 200 );"
);
Expand Down
6 changes: 3 additions & 3 deletions packages/remix-react/components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1536,11 +1536,11 @@ export const LiveReload =
? () => null
: function LiveReload({
port = Number(process.env.REMIX_DEV_SERVER_WS_PORT || 8002),
timeout = 1000,
timeoutMs = 1000,
nonce = undefined,
}: {
port?: number;
timeout?: number;
timeoutMs?: number;
/**
* @deprecated this property is no longer relevant.
*/
Expand Down Expand Up @@ -1584,7 +1584,7 @@ export const LiveReload =
remixLiveReloadConnect({
onOpen: () => window.location.reload(),
}),
${String(timeout)}
${String(timeoutMs)}
);
}
};
Expand Down

0 comments on commit 040b509

Please sign in to comment.