Thursday, April 25, 2019

ReactJS

React JS
           

  • Suitable for large web application which use the data change  over the time without load the entire page.
  • There is the thing called react native use for mobile applications.
  • Speed ,simplicity and scalability are the main reasonse for use it.Severs as the view MVC architecture.
  • Data flow from parent component to child component and action flow from child component to parent component.
Component life cycle
React component extend from React.There are set of method in react component.

1.constructor
      Declare state and bind context to life cycle events.
      Always call super to bind
      Do not call setState.

2.render
     Called evereytime state or props are getting changed.
     Rendering the component.

3.componentDidMount
     Can interact with DOM.
     Ajex calls and update the state.

4.getDerivedStateFromProps
    Use to update state from props.
    Recommends to not to use this.
 
5.shouldComponentUpdate
     Use to decide the component update or not.
     If is required can use fro performance enhncement.

6.componentDidUpdate
    After component got update.
    when it return fslse this method not run.
    Use this to interact with Dom after a Component update.

7.componentWillUnmount
     Before removing the component
     should not call setState.
     Clean up tasks.

8.getDerivedStateFromError/componentDidCatch
     get error related the stste.
 
 Babel
  •    most popular JavaScript transpiler.convert JavaScript se6 features to compatible version.supports to JSX and FLOW.

webpack
  •  most famous module bundler.Supports commonJS and AMD
  •  Not only that support fro build system as well as module bundling.

parcel
  •  fastest module bundler. on version over configurations.
  •  support for JSX,SCSS,LESS,SVG,TypeScript etc.
  •  Plugins available for extension and plugins are automatically detected.

  ReactJS use for develop and maintained facebook and instergram.

No comments:

Post a Comment