3 ms·
Ok, so, what problem do Hooks solve for me, as a ClojureScript/Rum user? (apart from compatibility with other libraries that use them)
by jwr 7y ago
Ok, so, what problem do Hooks solve for me, as a ClojureScript/Rum user?
(apart from compatibility with other libraries that use them)
- lilactown 7y agoHere's a rundown on mixins vs. hooks: https://reactjs.org/blog/2016/07/13/mixins-considered-harmful.html https://reactjs.org/blog/2016/07/13/mixins-considered-harmfu... I haven't used Rum in anger, but I do use reagent at work, and there are compatibility tradeoffs not just with other libs but also React itself that storing lots of state outside of the component tree in a mutable ref causes. There's potentially a lot of work to be done to support React concurrent mode, which has a measurable impact to the user experience of apps that we build. Following best practices set by the React team - including using hooks for sharing and composing behaviors - sets us up better to take advantage of that in the future. Ultimately though you don't need to rewrite your Rum/reagent apps, but instead there's an onus on the maintainers of those libs to build scaffolding around their lib code and encourage their users to migrate in a direction that will benefit them.