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
I tried it but there was several errors with the latest versions of React.
At the end, I achieved basically the same result using https://github.com/httptoolkit/react-reverse-portal and building some component around it.
Basically I just created a Provider that store a list of mounted components (the core function is):
and then I invoke this function in the KeepAlive component using the useEffect.
Since this implementation uses react-reverse-portal I can use the standard useEffect hooks my component and all looks like super.
What do you think to consider to rewrite react-keep-alive with this suggestion so to be more compatible with latest version of React and then remove all the event communication inside of it?
The text was updated successfully, but these errors were encountered:
I tried it but there was several errors with the latest versions of React.
At the end, I achieved basically the same result using https://github.com/httptoolkit/react-reverse-portal and building some component around it.
Basically I just created a Provider that store a list of mounted components (the core function is):
and the render is like
and then I invoke this function in the KeepAlive component using the useEffect.
Since this implementation uses react-reverse-portal I can use the standard useEffect hooks my component and all looks like super.
What do you think to consider to rewrite react-keep-alive with this suggestion so to be more compatible with latest version of React and then remove all the event communication inside of it?
The text was updated successfully, but these errors were encountered: