In Vue you have community created plugins to extend Vues functionality. What is the equivalent in React?
This is a legit question from a library author wanting to cross port.
In Vue you have community created plugins to extend Vues functionality. What is the equivalent in React?
This is a legit question from a library author wanting to cross port.
For further actions, you may consider blocking this person and/or reporting abuse
Gabriel -
Rajesh Dhiman -
Amaresh Adak -
Idris Gadi -
Top comments (5)
As far as I know, since React is not really a framework, but a library 🙄, you don't really need a plugin system to extend React.
There's a myriad of npm packages with "react" in the name. They're just not plugins.
Interesting, I didn't expect that 😅
I think the closest thing right now are "Hooks". In theory they are "just functions". In practice they are functions that follow some rules and that you put in a component. React just knows when to call them.
The second closest I guess is "High Order Components". That is a component that controls another component.
Thank you Heiker, I have a feeling I need to write a hook but would you mind taking a look at my library and giving your opinion?
npmjs.com/package/reactive-css-pro...
Sounds like I need to wrap the library in a hook then publish that with a react- prefix
Yes. I think hooks are a good fit for this.