Skip to content

Conversation

@AlexanderKaran
Copy link
Collaborator

@AlexanderKaran AlexanderKaran commented Feb 29, 2024

Fixes: #224

  • Fixed broken useEffect that was stopping correct rendering in <StrictMode>
  • Updated examples to use the new React18 rendering method
  • Add strict mode options to the integration tests

I did notice that the Hydration example is broken (even before the changes). I logged a bug for this: #223

@AlexanderKaran AlexanderKaran linked an issue Feb 29, 2024 that may be closed by this pull request
throw new Error('No root element found to render basic routing example');

const root = createRoot(container);
root.render(<App />);
Copy link
Collaborator

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 ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See integration tests file

Copy link
Collaborator

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

pancaspe87
pancaspe87 previously approved these changes Feb 29, 2024
}: RouterProps) => {
useEffect(() => {
const { unlisten } = getRouterState();
const { unlisten } = getRouterState();
Copy link
Collaborator

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)

@JohnsonChauAtlassian
Copy link

Cloned locally and confirmed that it works with/without strict mode in R18 concurrent mode for basic-routing example

@AlexanderKaran AlexanderKaran merged commit a00d5b3 into master Feb 29, 2024
@AlexanderKaran AlexanderKaran deleted the 222-doesnt-not-work-with-react-18-strictmodel branch February 29, 2024 04:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Doesn't not work with React 18 StrictModel

5 participants