One Router with Blaze and another with React


#1

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.


#2

Does ReactLayout not work?


#3

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.


#4

As far i found two solutions

  1. Clear BlazeLayout and mount the react component in the same route. And vise versa.
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);
  },
});
  1. Render react component inside the Blaze Template with ‘react-template-helper’

Could be there more solutions?