Did you know you can use React Router with Preact, no -compat?
by developitJavaScript
Last 12 weeks · 0 commits
1 of 6 standards met
Edit: Just realized pull request /pull/2 is exactly about this** react-router's Switch looks for a function which isn't there. If I try to shim it by then it looks for a function , When it is shimmed as , Switch starts to look for the component's props but the VNode doesn't have it, so Children.forEach should be which finally results in a object returned from Switch. However, one would rather import instead of rewriting it. Don't know how this would be solved other than using when or other complex routing elements are needed.
Repository: developit/react-router-4-test. Description: Did you know you can use React Router with Preact, no -compat? Stars: 35, Forks: 7. Primary language: JavaScript. Languages: JavaScript (73.7%), CSS (19.4%), HTML (6.8%). Homepage: https://react-router-4-test.surge.sh/ Open PRs: 2, open issues: 4. Last activity: 8y ago. Community health: 28%. Top contributors: developit, conorcussell.
I'm considering using Preact. I've seen it supports Material design (https://github.com/developit/preact-mdl) and I don't know if react router v4 works without needing to change anything. I'm guessing there might have been a PR on Reat-Router to make it work seamlessly. Do I need to do any extra work to get Preact and React-Router working together?
I just went through the process of removing preact-compat from my existing app which was using react-router. I used this repo as a guide but I stumbled around awhile before I realized that all I had to do was copy into my project and modify in the webpack config. Since this is one of the top search results for 'preact react router' it would be awesome if some of these details could be added to the readme. Also no longer exists in webpack 2. Let me know if I can help.