Drawer with React-Router 6

0 Answers 453 Views
Drawer General Discussions
Bernd
Top achievements
Rank 5
Bronze
Bronze
Bronze
Bernd asked on 03 Aug 2022, 08:53 AM

Hi.

As the example on the documentation pages still uses react router 4 and I had to struggle a bit to make the Drawer component work with version 6, I thought I'd share an example of a possible solution. It's a little hacky because I send all unknown routes to home but it works. :-) 

Hope this helps somebody.

https://stackblitz.com/edit/react-kzrru7?file=app%2Fmain.tsx

Greetings,

Bernd

 

Konstantin Dikov
Telerik team
commented on 03 Aug 2022, 09:55 AM

Hi Bernd,

The example in the documentation needs to be updated to use router version 6. I have already made an example for the documentation with the new version (just needs to be uploaded). It uses BrowserRouter:

Bernd
Top achievements
Rank 5
Bronze
Bronze
Bronze
commented on 03 Aug 2022, 11:33 AM

Hi!

Great! I wasn't aware of this, of course. I needed to use HashRouter for various reasons but anyway.

Thanks!

 

No answers yet. Maybe you can help?

Tags
Drawer General Discussions
Asked by
Bernd
Top achievements
Rank 5
Bronze
Bronze
Bronze
Share this question
or