Looking at devtools profiling, when I move between two routes with the same layoutTemplate
, the layout's helpers are being rerun, and it looks like the HTML is being rerendered as well. How can I have iron router only render the yields and leave the layout alone?
EDIT code:
Router.map ->
@route '/foo',
layoutTemplate: 'headered'
@route '/bar',
layoutTemplate: 'headered'
Template.headered.helpers
test: ->
console.log 'gets run when switching from /foo to /bar'
<template name="headered">
{{test}}
<header>
{{getReactiveData}}
</header>
{{> yield}}
</template>
I don't want the <header>
node to be rerendered. I don't want getReactiveData
to be called when the route changes (only when the data changes).
There's something abnormal about my app, because IR doesn't normally rerender the layout between routes: