atlassian-labs / react-resource-router

Configuration driven routing solution for React SPAs that manages route matching, data fetching and progressive rendering
https://atlassian-labs.github.io/react-resource-router
Apache License 2.0
198 stars 28 forks source link

Doesn't not work with React 18 StrictModel #222

Closed liamqma closed 7 months ago

liamqma commented 7 months ago

To Reproduce the problem:

  1. Go to https://github.com/atlassian-labs/react-resource-router/blob/master/examples/basic-routing/index.tsx#L45
  2. Enable Strict Mode
const root = ReactDOM.createRoot(
  document.getElementById('root')
);

root.render(
  <React.StrictMode>
      <App />
  </React.StrictMode>
);
  1. Then run npm start
  2. Go http://localhost:8080/basic-routing/

Clicking on the link doesn't trigger the page change.

ebergama commented 7 months ago

There were some changes introduced with React 18 to the strict mode

Also, some interesting threads

Lastly, not sure if related, but react-router v5 does not work with R18

https://github.com/facebook/react/issues/24451