SolidJSS
SolidJS2y ago
8 replies
gabriel

How does the "You might not need an effect" page from react.dev translate to SolidJS's effects?

I feel like they are both the same construct, but since Solid has a fundamentally different way of rendering and constructing components it feels to me like a few things should differ. I was reading through it and thinking about this as I wanted to improve my own SolidJS code.

One of the things I am already sure it differs on is for the section of "Resetting all state when a prop changes": https://react.dev/learn/you-might-not-need-an-effect#resetting-all-state-when-a-prop-changes.
But as I mentioned, I'm not exactly sure how this section would look like on a SolidJS docs as we don't have one page for this, at least AFAIK. I first wanted to ask a question about this specific section of this react.dev page but I think it might be more interesting to actually discuss the whole page as there may be many things from this page that both might not apply as well might not be the optimal solution inside of SolidJS.
The library for web and native user interfaces
You Might Not Need an Effect – React
Was this page helpful?