Whether React is a library or a framework ?
--
Before beginning our topic lets have a glimpse over ReactJS. What is ReactJS, who created it, why so popular and its features.
React is an open-source front-end JavaScript library for building user interfaces or UI components.
It is developed and maintained by Facebook and a community of individual developers and companies. It is used to created full fledged web applications.
Early history of React
Initially it was created by Jordan Walke, a software engineer at Facebook, who released an early prototype of React called “FaxJS”. It was first deployed on Facebook’s News Feed in 2011 and later on Instagram in 2012. It was open-sourced at JSConf US in May 2013.
In may 2015, React Native was introduced which enables creating Native android and iOS application using React.
And with React 16.8, hooks were introduced, which lets you use states and other React features without writing a class, using only functions.
React Concepts
- Virtual DOM which is much faster than real DOM.
- Unidirectional Dataflow, which makes the application more flexible that leads to increase efficiency.
- Building web application just like LEGO blocks by components.
- JSX stands for JavaScript XML. It is a JavaScript syntax extension. Its an XML or HTML like syntax used by React. This syntax is processed into JavaScript calls of React Framework. It extends the ES6 so that HTML like text can co-exist with JavaScript react code.
Library or a framework
Many people refers ReactJS as a framework which is completely wrong, it has many features which makes it look like a framework, but here is the key thing that it’s a library.
Frameworks are software that are developed and used by developers to build applications. They are common choices of companies and persons creating enterprise, or any large scale applications, as it includes all the resources that a large scale applications will need.
Everything which you need to create a application already exists in framework when it is generated just like Angular.
Libraries are basically collections of files, programs, scripts or function which can be used by computer programs to develop applications. Means you need to create everything from scratch or use third party tools.
As React is a library so its upon you that which tool you want to use in your application. But don’t many React-based frameworks have cropped up in recent years to provide developers with a more powerful set of built-in tools. These allow you to build projects faster without needing as many third-party libraries.
Some of the most popular of these frameworks include Next.js, Gatsby, and Redwood.js, all of which are used to create full-scale dynamic and static React applications.
If you want to learn more about ReactJS you can visit here