4Catalyzer / found

Extensible route-based routing for React applications
https://4catalyzer.github.io/found/
MIT License
792 stars 55 forks source link

Question: Weird behaviour for Not found #962

Open 0xHexE opened 2 years ago

0xHexE commented 2 years ago

I have the following routeConfig.

[
  {
    path: '/test',
    Component: () => <p>Test</p>,
  },
  {
    path: '/test2',
    Component: () => <p>Test2</p>,
  },
]

I have an example here https://stackblitz.com/edit/react-ts-vzxs8c

https://react-ts-vzxs8c.stackblitz.io/test

https://react-ts-vzxs8c.stackblitz.io/ Gives me 404, but it is matching / App right then why it is giving a not found page? We should pass not found to the App instead?

If I want to configure it in this way what should I do?

0xHexE commented 2 years ago

I was about to report another bug. But found another related to #961. When you change the URLs using the button, it is not showing working.

And the bug I was going to report was, It is rendering dom when we change the route. It renders again the app and another one too which leads to loose states like focus and all.

puchm commented 2 years ago

Can you check what it's like if you change the createRoot part to the old ReactDOM.render way? E.g. see this comment: https://github.com/4Catalyzer/found/issues/968#issuecomment-1113285768