ReactJS:
ReactJS is a JavaScript library. It’s used for developing complex and interactive web and mobile UI, especially for a Single Page Application(SPA). ReactJS helps to build reusable UI components because it follows the component based approach.
React Higher-Order components and example:
Higher-order component is an advanced way of reusing the component logic.
Examples:
- Render high jacking.
- Props manipulation.
- State abstraction and manipulation.
- Code reuse, logic, and bootstrap abstraction.
Difference between Virtual Dom and Real Dom:
Virtual Dom:
- Fast update but can’t directly update HTML.
- DOM manipulation is very easy.
- No memory wastage.
- Update JSX, If element update.
Real Dom:
- Slow update but directly update HTML.
- DOM manipulation is very expensive.
- Too much memory wastage.
- Create a new Dom if element update.
UseState in React:
UseState is a built-in hook that allows adding state to functional components in react package. We use it inside a function component. We use it to create a piece of state without switching to class components.
Reduce in React:
Reduce is a function that specifies how applications state changes in response to an action. It works by taking previous states and actions then returning new values.
Difference between JSX and JS:
JSX
- JSX is JavaScript XML. Which is a combination of HTML and JavaScript.
- Use to write react component.
- Making the code easier to read and understandable for the user.
JS
- JS is a scripting language of ECMAScript.
- Use to make the webpage more interactive.
- Basically, it adds life and creativity to a website, making it more engaging.
ReactJS Optimization:
By using the below roles we optimize a react application-
- Dependency optimization.
- Using immutable Data structures.
- Avoiding props in initial states.
- Memorize React components.
- CSS animation Instead of JS animation.
Happy Learning !!
Top comments (0)