Introduction to react
React js Introduction
React js Features
- One-way Data Binding
- Virtual DOM
- Pros and cons of React
Advantage of React
- Easy to Learn and Use
- Creating Dynamic Web Applications Becomes Easier
- Reusable Components
- Performance Enhancement
- The Support of Handy Tools
- Known to be SEO Friendly
- Scope for Testing the Codes
Disadvantage of React
- The high pace of development
- Poor Documentation
- View Part
- JSX as a barrier
React States and Props
- Props are read-only.
- Props are immutable.
- Props are used to communicate between components.
- Props allow you to pass data from one component to other components as an argument.
- Props make components reusable.
- Props are external and controlled by whatever renders the component.
- State changes can be asynchronous.
- State is mutable.
- State holds information about the components.
- State cannot be accessed by child components.
- States can be used for rendering dynamic changes with the component.
- The State is internal and controlled by the React Component itself.
Pros and cons
- Both are plain JS object.
- Both can contain default values.
- Both are read-only when they are using by this.