-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed bug causing routes not to render on change #224
Fixed bug causing routes not to render on change #224
Conversation
throw new Error('No root element found to render basic routing example'); | ||
|
||
const root = createRoot(container); | ||
root.render(<App />); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How are we testing if it works with StrictMode ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See integration tests file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeahhh, I was looking at it now
src/controllers/router/index.tsx
Outdated
@@ -15,13 +15,13 @@ export const Router = ({ | |||
onPrefetch, | |||
routes, | |||
}: RouterProps) => { | |||
useEffect(() => { | |||
const { unlisten } = getRouterState(); | |||
const { unlisten } = getRouterState(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine, even if I think the problem is the use of getRouterState
which is bad (as out of react control flow)
…ime to unmount in test
306fe69
Cloned locally and confirmed that it works with/without strict mode in R18 concurrent mode for basic-routing example |
Fixes: #224
useEffect
that was stopping correct rendering in<StrictMode>
I did notice that the Hydration example is broken (even before the changes). I logged a bug for this: #223