Closed aykutyaman closed 8 years ago
This is what I found, and it works. So I am gonna close the issue.
// Blaze part
FlowRouter.route('/users/profile/:_id', {
name: 'user_profile',
action() {
var reactRoot = document.getElementById('react-root');
if (reactRoot) {
ReactDOM.unmountComponentAtNode(reactRoot);
}
BlazeLayout.render('App_layout', {main: 'user_profile'});
}
});
// React part
FlowRouter.route('/sales', {
name: 'sales',
action() {
BlazeLayout.reset();
mount(MainLayoutCtx, {
content: () => (<div>hello</div>),
});
},
});
I want to migrate my app from Blaze to React using Mantra Spec. I am trying to migrate progressively, so I have to run Blaze and React at the same time. I had an issue with the mount and unmount of the React components. When I move from the route, which renders React component, in a different route which renders Blaze, React part does not unmount. So I have something like this in my DOM: