baobab-react with react-router >=1.0
See original GitHub issuerooting-our-top-level-componen describes how to root a top level component.
ReactDom.render(
require('baobab-react/higher-order').root(tree, App),
elem
)
With react-router >= 1.0, top level components are rendered however similar to this
ReactDom.render(
<Router history={appHistory}>...</Router>,
elem
)
What is the suggested pattern to use react-baobab with react-router >=1.0?
Applying the mixin pattern (mixins.root
and mixins.branch
) for rooting the baobab doesn’t seem to work with react-router >=1.0 either.
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
React-Router 1.0.0 Uncaught Error: Invariant Violation
Following lines resolved my error var ReactDOM = require('react-dom'); var ReactRouter = require('react-router'); var Router = ReactRouter.
Read more >React Router v5.1
Today, we are releasing React Router version 5.1. This post will discuss the 5.1 release as well as discuss a few things you...
Read more >Keywords - react-router - npm
react-router. TypeScript icon, indicating that this package has built-in type declarations. 1.0.3 • Public • Published 7 years ago.
Read more >Flux Architecture: Routing with react-router 1.0 | egghead.io
In this lesson we'll introduce routing into our application using react-router 1.0.
Read more >React Router: Home v6.6.1
I'm New. Start with the tutorial. It will quickly introduce you to the primary features of React Router: from configuring routes, to loading...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The current signature of the
root
function isroot(tree, Component
(code here). So it seems that the tree you provide is not a baobab tree. One thing you can also check is if you have the Baobab dep more than once in your deps because if the one used by the higher order function is not the same as the one from which you got your tree, it might cause issues.I am happy it worked @hansman. It makes me think I should rollback to identity checking rather than checking the class instance in my tests for a Baobab tree. This would avoid this kind of problems.