Posts

Showing posts with the label ReactJS Component API

What is ReactJS Component API?

Image
In this tutorial we are reading about  “ What is ReactJS Component API ?”. There are three methods to be explained in the React Component API setState() forceUpdate() ReactDOM.findDOMNode() Instead of a React Component are created internally in React when rendering.These instances are reused in subsequent renders,and can be accessed in your component methods as this. Set State setState()  method is used for  updating  the state of the component. State method is useful to add the changes to the original state but it will not replace the state. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 import  React from  'react' ; class  App  extends  React. Component   { constructor ( )   { super ( ) ; this . state   =   { data :   [ ] } this . setStateHandler   =   this . setStateHandler . bind ( this ) ; } ; setStateHandler ( )   { var  item  =   "setState..." v...