Content
@
https://warpcast.com/~/channel/react
0 reply
0 recast
0 reaction
Darryl Yeo đ ïž
@darrylyeo
Five more hours of my life debugging a React-related issue that I'II never get back đ« Youâre telling me if I want to conditionally render stuff that relies on state from a Provider, I have to break out the entire subtree into a `useMemo` expression to prevent the Provider from resetting its state whenever an unrelated component randomly decides to re-render?? Make it make sense đ€Ą
8 replies
3 recasts
21 reactions
typeof.eth đ”
@typeof.eth
React isnât easy, but if you learn the rules, debugging and fixing stuff like this (or avoiding the issue altogether) becomes second nature. Not saying itâs a you problem, but I feel like React is sold as an easy framework but I disagree with that once a project becomes complex enough.
1 reply
0 recast
1 reaction
typeof.eth đ”
@typeof.eth
Fwiw, I feel like there might be a better solution than useMemo to fix this. Happy to help brainstorm a bit if you want
1 reply
0 recast
1 reaction
Darryl Yeo đ ïž
@darrylyeo
Thanks â the solution I found does work so I donât think I need to revisit it again. But IDK man â all this just further solidifies for me that Reactâs whole re-rendering thing is a relic of the past and just an entire layer of complexity that shouldnât need to exist anymore. Iâd rather just start with a framework with more sensible defaults so I can focus my time on making a great experience. https://joshcollinsworth.com/blog/antiquated-react#react-hooks-are-actually-kind-of-outdated
0 reply
0 recast
0 reaction