4 ms·
What is difference between a front-end library and a front-end framework?
by vishnu_ks 6y ago
What is difference between a front-end library and a front-end framework?
- jfkebwjsbx 6y agoA library is added to a project. A project is added to a framework.
- dntrkv 6y agoI agree with this definition. So how is React a library? You can't just utilize part of React within an existing Angular app. I've built shims between the two frameworks and you can't just use React inside of Angular. When you utilize a React component inside of Angular, everything Angular about the application goes out the window and it becomes a mini React app starting from that component, just with the data originating from an Angular app. The definition of a framework boils down to inversion of control, right? You define your application, and then it is run within the React "framework" context, which calls various predefined methods/functions. All of the lifecycle methods in React are a good indicator, to me, that it is indeed a framework. You define these functions, and they are called by the framework. Inversion of control.
- stblack 6y agoYour code calls a library. A framework calls your code. Really great explanation here: https://stackoverflow.com/posts/15600924/revisions https://stackoverflow.com/posts/15600924/revisions Edit: another really nice exposé here: The Difference Between a Framework and a Library — https://www.freecodecamp.org/news/the-difference-between-a-framework-and-a-library-bd133054023f/ https://www.freecodecamp.org/news/the-difference-between-a-f...