Hi. I have an application made with FlowRouter and BlazeLayout. I want to create new routes with React. What is the best way to do this?
I have already installed and created a new route, but react content just being added instead of replacing.
Hi. I have an application made with FlowRouter and BlazeLayout. I want to create new routes with React. What is the best way to do this?
I have already installed and created a new route, but react content just being added instead of replacing.
I use react-mounter which is do the same. I does display the component, but not remove it when i leave the route. And does not remove content rendered by BlazeLayout.
As far i found two solutions
FlowRouter.route('/blaze-route', {
name: 'Route.blaze',
action() {
BlazeLayout.render('Layout', {
header: 'Header',
template: 'Default'
});
mount(() => (<div></div>));
}
});
FlowRouter.route('/react-route', {
name: 'Route.react',
action() {
BlazeLayout.reset();
mount(ReactComponent);
},
});
Could be there more solutions?