Skip to content

Commit

Permalink
chore: revert some
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Nov 27, 2023
1 parent 2e42c32 commit ca9ab82
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/remix-react/browser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,7 @@ export function RemixBrowser(_props: RemixBrowserProps): ReactElement {
// towards determining the route matches.
let initialPathname = window.__remixContext.url;
let hydratedPathname = window.location.pathname;
// TODO: consider basename
if (0 && initialPathname !== hydratedPathname) {
if (initialPathname !== hydratedPathname) {
let errorMsg =
`Initial URL (${initialPathname}) does not match URL at time of hydration ` +
`(${hydratedPathname}), reloading page...`;
Expand Down Expand Up @@ -234,6 +233,7 @@ export function RemixBrowser(_props: RemixBrowserProps): ReactElement {
// removed from a component, but the styles will still be present in the
// server HTML. This allows our HMR logic to clear the critical CSS state.

// eslint-disable-next-line react-hooks/rules-of-hooks
let [criticalCss, clearCriticalCss] = React.useReducer(
criticalCssReducer,
window.__remixContext.criticalCss
Expand All @@ -243,8 +243,10 @@ export function RemixBrowser(_props: RemixBrowserProps): ReactElement {
// This is due to the shit circuit return above which is an exceptional
// scenario which we can't hydrate anyway

// eslint-disable-next-line react-hooks/rules-of-hooks
let [location, setLocation] = React.useState(router.state.location);

// eslint-disable-next-line react-hooks/rules-of-hooks
React.useLayoutEffect(() => {
return router.subscribe((newState) => {
if (newState.location !== location) {
Expand Down

0 comments on commit ca9ab82

Please sign in to comment.