Content pfp
Content
@
https://warpcast.com/~/channel/react
0 reply
0 recast
0 reaction

Darryl Yeo đŸ› ïž pfp
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 đŸ”” pfp
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 đŸ”” pfp
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 đŸ› ïž pfp
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