Why is FlowRouter rerendering the whole layout?


#1

Hey,
if I remeber right, Flow Router wouldn’t rerender the whole layout if it stays on “the same route” (this was the behavior in Blaze - see this issue). For example, I’ve this route:

FlowRouter.route("/category/:catName", {

    name:'category',

    action() {
        mount(Layout, {
            content: (<div>hello</div>)
        });
    }
});

This is my layout:

export class Layout extends Tracker.Component {


 
    render() {

        console.log("LAYOUT");
        return (
            <div id="layout">

                <div className="bg-1"></div>

                <div className="content-box white z-depth-1">
                    
                    <div id="start">
                       <a href="/category/test">sdsd</a>
                    </div>
                </div>


        </div>);
    }
};

So for example, if I move from /category/welcome to /category/test, the render() method is called again. So why do we have this difference between Blaze & React? As far as I know, FR should provide better rendering control and now we have 2 different behaviors on Blaze and React?


#2

It’s possible that it was overlooked in react-mounter due to React being more performant on re-renders - the code for that is implemented in blaze-layout, not flow router (which doesn’t handle ui)