4 ms·
To me the biggest difference is that [Reason]React focuses on components which encapsulate state, while Elm focuses on data structures and pure stateless functi
by Rotareti 7y ago
To me the biggest difference is that [Reason]React focuses on components which encapsulate state, while Elm focuses on data structures and pure stateless functions. Both approaches have pros and cons. You can design a [Reason]React app similar to an Elm app, if you use pure stateless components exclusively and handle your state with few reducers, but you won't get the same smooth experience which you get with Elm. I still favor React though. React's component interface adds some friction and complexity, but it's also a nice abstraction which helps a lot with code sharing, especially when sharing with third parties. Thus the striving ecosystem (UI frameworks, UI builders, etc.) in React.
I made a round trip over the last years from React/TS to Elm to ReasonReact back to React/TS. React/TS is the least attractive, but it's the one I get most done with. Plus the situation in React has gotten much better since Hooks, PureComponents, Context API. I'm glad the mess with class components is finally over.