You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 16, 2021. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 16, 2021. It is now read-only.
Deep comparing props in shouldComponentUpdate (react-helmet usage) #391
The thing is that this next comparison is true when using preact-compat:
this.props.children===this.props.children[0]
So you can see that we'll enter an infinite loop and reach max call stack size. Am I missing something? Or doing something wrong?
I know preact-helmet exists. I'm just wondering if there's a valid solution for this so I can avoid changing the project code, since I'm using the new API offered by react-helmet version 5.x onwards.
For my use case, the simplest option was to rewrite my code to use the v4 interface. If you're using v5 of react-helmet, the old API is still supported, so you can continue to use v5.
Activity
bassarisse commentedon May 30, 2017
I just noticed that
preact-helmetdoes this:Is this a good solution?
tannerlinsley commentedon Mar 5, 2018
This is affecting React-Static users who opt for preact. What's the game plan here?
petermikitsh commentedon Sep 28, 2018
Any updates on this? I've attempted adopting preact, and I'm also using the latest react-helmet, and I noticed this issue.
petermikitsh commentedon Sep 28, 2018
For my use case, the simplest option was to rewrite my code to use the v4 interface. If you're using v5 of react-helmet, the old API is still supported, so you can continue to use v5.
Old code:
New code:
Infinite call stacks are gone now. 👍
esbenam commentedon May 11, 2020
react-fast-compare just added support for Preact in react-fast-compare@3.1.1. Maybe this could be resolved by upgrading the dependency in react-helmet (added a comment in the preact-compat issue)