4 ms·
I'm EXTREMELY confused about what's going on with react router, the documentation seems mismatched from versions, and any tips I find online seem to be for some
by komali2 4y ago
I'm EXTREMELY confused about what's going on with react router, the documentation seems mismatched from versions, and any tips I find online seem to be for some now defunct version.
I remember a few months back I was working on a react app with react router and trying to figure out how to hook into all route changes for some reason, and all the documentation centered around "picking a router," of which there was `createBrowserRouter`, `createHashRouter`, etc, all which had different considerations. But I couldn't find an invocation for any of those! Just a single `useRoutes` and that was it lol. And the argument for it was just objects and arrays, with element properties set to JSX. From my understanding, we shouldn't have had history working at all without explicitly setting it to do so, but it all was working, so... who knows?
- siquick 4y agoReact Router devs have a history of breaking changes and some spikey behaviour so this doesn’t surprise.