Reputation: 69
Please someone answer by justifying the definition of library and framework. "Your code calls library whereas framework calls your code."
Upvotes: 3
Views: 1204
Reputation: 6107
React cannot be considered a library given provided, absolutely correct, and only one that makes any sense definition of the difference between framework and library.
The library is just a set of methods/functions.
The framework provides a frame for work, it requires the code to be written in a certain way.
Considering the above, React obviously is the framework. Very complex, very opinionated framework.
Why it has been promoted as a library?
IMHO because promoters of React are cheap manipulators who wanted to steal the popularity of jQuery - the most popular JavaScript library.
Good library vs framework article. The author uses jQuery as an example of a library and Vue as an example of a framework. Probably, just in order to not tease geese. But Vue code from provided example is almost similar to analogic React code.
Upvotes: 7
Reputation: 924
The reason is basically related to use case of both the technologies, as React is called as a library because of its behavior of easy to fit into any js environment and doesn't bound user to use things React way, while one the other hand Angular is complete MVC (Model View Controller) architecture, and restrict user to follow its pattern of framework.
Upvotes: 1