3 ms·
React is a framework. There is inversion of control: React calls into component to make them go, not the other way around like a normal dependency.
by spankalee 3y ago
React is a framework. There is inversion of control: React calls into component to make them go, not the other way around like a normal dependency.
- throwaway290 3y agoHave you used React? It doesn't do that stuff for you. You need to call another lib (react-dom) to make it happen. If you are not aware about it perhaps you've used a framework or template not react itself :)
- iamcreasy 3y agoDistinction between library and framework has nothing to do with how much stuff they do. The difference is - as the parent comment said - inversion of control. Can you create React component and take full control of component lifecycle outside of React rendering loop? - if yes, then you can call it a library. I think React doc, by calling Next a framework, is referring to a set of practices and protocols. But different usage of same nomenclature in the same discipline is very common.
- throwaway290 3y ago> Can you create React component and take full control of component lifecycle outside of React rendering loop? Yes? If you create a React component, it does nothing. You define the lifecycle when you call ReactDOM. But you don't need to call ReactDOM. Call whatever you want.