Assignment 1
Assignment 1
Ans
React is a open source JavaScript library for building user interface it is used to
build single page application and allow to create reusable UI component. A key
advantage of react is rely on re -render those part of the page that have been changed
avoiding unnecessary re-rendering of unchanged DOM element.
Why react
It allow developer on easy way to create application with a lot of functionality at once
this mean our app doesn’t need to be complicated as other framework instead you cab
focus on building feature in your app
Jsx syntax for extends HTML : using reactjs allow to use declarative html syntax directly
in your code it decode html and creating dom tree and then manipulating them with
javascript
Q What are the main features of ReactJS? What is the meaning of the term SPA?
Ans
Component based architecture – where the ui broken down into resuable component It
can be class based or functional
2 jsx – react uses jsx a syntax extension that allow developer to write html inside JS
3 one way data binding – react uses one way data binding meaning data flow in a single
direction from parent to child component via props
4 state management – react mange component state efficiently using the useState hook
for functional / component or this state for class component
Class component
Class component are ES6 classes that extends react.components they include additional
features like state management and lifecycle method