preact-router
preact-router copied to clipboard
[discuss, help] Understanding of <Match> behavior
https://github.com/developit/preact-router/blob/83cf77acad33f9c8dd4a9104f23be90c9b8d381c/src/match.js#L9
Why do we setup subscribers after rendering the component?
But at the same time we expect eval children[0] and retrieve an expression. But maybe this expression needs to read subscribers to return the proper component to render...
componentDidMount() only runs for client-side renders. componentWillMount() runs during SSR, which means setting up subscriptions there would trigger a memory leak (as they are never removed).
But if this is the only problem wouldn't be the best approach to check by any means the current env:
if (ENV === 'SSR') .. whatsoever
right?