3 ms·
It would be possible have a purely functional React if 1) the current state of the component were injected via an argument, and 2) instead of a setState call we
by ratww 5y ago
It would be possible have a purely functional React if 1) the current state of the component were injected via an argument, and 2) instead of a setState call we just returned the state changes we needed.
With that our code would be 100% pure, and all the side-effect part would live outside our JSX files, similar to how Haskell does.