Introduction to React JS
Reactjs API with Examples
Here will understand three important methods: setState(), forceUpdate and ReactDOM.findDOMNode()
import React, { Component } from 'react' class Ravi extends React.Component{ constructor(){ super() this.state={ data: 0 } } inc(){ this.setState({ data: this.state.data +1 })} render(){ return( <div> {this.state.data} <button onClick={()=>this.inc()}> Button</button> </div> ) } } export default Ravi;