4 ms·
>But you can write React in this library-like manner too and nobody argues that React isn’t a framework. >React - The library for web and native user interface
by croes 3y ago
>But you can write React in this library-like manner too and nobody argues that React isn’t a framework.
>React - The library for web and native user interfaces
https://react.dev/ https://react.dev/
https://www.reddit.com/r/reactjs/comments/126uzfo/why_is_react_considered_a_library_and_not_a/ https://www.reddit.com/r/reactjs/comments/126uzfo/why_is_rea...
https://medium.com/@Angie.O/why-react-is-a-library-and-not-a-framework-533d95692fe1 https://medium.com/@Angie.O/why-react-is-a-library-and-not-a...
https://www.oreilly.com/library/view/what-react-is/9781491996744/ch01.html https://www.oreilly.com/library/view/what-react-is/978149199...
- hobofan 3y agoYeah, that sentence surprised me too. While I generally would also consider React more a library than a framework, I think there are arguments to be made that it's a framework. If we go by the common "your code calls a library; a framework calls your code" distinction, then you definitely have to structure your components in a very specific manner so that the React internals can "call your code" to e.g. render one component from it's parent component.
- leetrout 3y agoMy favorite quip (not mine): somethings wrong when express is a "framework" and react is a "library".
- diggan 3y agoOne vital distinction is that even if you define 100 components, nothing will happen unless you call .render from react-dom. Nothing is automatically setup for you. Compare that to Laravel or anything else that is obviously a framework. You write code and put it in a file in the right place, and it gets picked up automatically, most of the time. This makes me still consider React a library, rather than a framework. But then there are tons of frameworks that uses React, nextjs is probably one of the more common ones.
- bcrosby95 3y agoNote that by this definition Spring Boot isn't a framework - you call SpringApplication.run to start it.
- diggan 3y agoForgive my ignorance, I'm not super deep into the Java ecosystem, but is Spring Boot the same as just "Spring"? Or what is the difference precisely?
- bcrosby95 3y agoSpring Boot is a layer on top of Spring that makes it easier to use.
- diggan 3y agoSounds to me like Spring Boot is a library to be used with the framework Spring in that case, as far as I can tell.
- deleted 3y ago[deleted]
- bcrosby95 3y agoIt's more than just a library, there are "starters" that they've developed that will pull in everything you need for certain stuff (such as web, or database, etc), and it will auto-find and configure everything for you. Furthermore, you can hand configure Spring. If anything, the framework here is the Java servlet container, not Spring. Spring just usually lives within that context. And at this point I'm not sure if that's completely true either. It's common to embed the servlet container - this is how Spring Boot works. I assume you can do that with raw Spring considering that's what Boot does, but I never bothered trying because I would just use Spring Boot at that point.
- Sankozi 3y ago
- tarcon 3y agoIf you use hooks, react expects code in certain places and in a certain order. At that point, react becomes framework-y.