I’ve been getting more comfortable with Iron Router but now want to implement ReactJs and I’ve been reading on Meteorhacks that using FlowRouter is better for the reactive paradigm.
One thing that i’ve noticed, and i’m totally a novice at React and Meteor in general, is that with Iron and FlowRouter you can bind data to a route. But it seems with React it binds the data to the UI leaving the router to only handle the job of routing.
Is this is a correct notion or would someone clarify the errors in my thinking about using these technologies together?
Quick question where can I find what other properties I can use on FlowLayout? For example are
’top’ and ‘main’ the only properties/methods that FlowLayout has? Is there a ‘bottom’ method for a footer? I went to the GitHub page for https://github.com/meteorhacks/flow-layout and to Atmosphere to see if there were anymore instructions but didn’t find any? Any direction pointing would be very much appreciated. Thank you.
FlowRouter doesn’t do anything in relation to templates, which is the point of it.
Not doing anything means no rendering of templates and no setting the data context of templates. The reason is that when a template receives its data context through e.g. IronRouter and the data changes reactively, the router hooks themselves must rerun in order to redefine the context and update the UI.
Keeping the flow of data – from some collection into some template – outside the scope of the router potentially makes it simpler both to reason about the app and to use something like React. For rendering templates with Blaze, FlowLayout can be used, and we now also have template level subscriptions.
The major advantage of using IronRouter, in my view, is that it takes the role of an application framework – meaning that it provides you with a pattern for organizing your templates and subscriptions.