When navigating error: 'Exception from Tracker recompute function'

When pressing back or navigating from a react component back to a blaze template, I get this error:

Error: Template “LAYOUTNAME” must render a React component as the only child of its parent element. Learn more at https://github.com/meteor/meteor/wiki/React-components-must-be-the-only-thing-in-their-wrapper-element

My project is currently supporting older blaze templates while moving to react and it dynamically figures out if it needs to render blaze or react. This isn’t a problem at all.

This error doesn’t even fire if I just press reload after it initially happens, or when I press back from react to react component. But this only happens when I’m using the more modern react components (function) instead of classes that extend react.component.

I thought maybe it was the wrapper that uses withTracker but I went to a plain template with no tracker dependency.

Any direction at all would help because I’ve been stumped all day.

I have more info based on some more experimenting.

There is something with the rendering and lifecycle of components that is different with classes vs. functions in when they are removed from the DOM / and or re-renders are attempted.

After updating react-template-helper to 0.2.12 from 0.2.11 it had a slightly telling error that hinted at it still trying to render the template despite it not being not the page anymore.

What I did to stop the error for now that was a mediocre/bad hack, I look for props that are being passed in from the router and if they don’t exist just return an empty div to render.