Martin Adamko
banner
martinadamko.bsky.social
Martin Adamko
@martinadamko.bsky.social
Crafting the UIs with React & React Native. #coding #specialtycoffee #kizomba #design #illustrations #fixedgear Košice/Prague/World
Give usePureEffect a shot in your next project. It offers a clean, predictable, and composable way to manage side effects. Let me know how it works for you!
January 12, 2025 at 10:04 PM
And here is the code optimized by React compiler: playground.react.dev#N4Igzg9grgTg...
React Compiler Playground
playground.react.dev
January 12, 2025 at 10:04 PM
The idea, actually two ideas, that remove memoization and simplify code:

- compare dependencies ourselves and skip effect (inspired by the custom comparison function of React.memo)
- declare effect callback outside of component function body and inject it with dependencies
January 12, 2025 at 10:04 PM