0 votes
in ReactJS by

What are stateful components?

1 Answer

0 votes
by

If the behaviour of a component is dependent on the state of the component then it can be termed as stateful component. These stateful components are always class components and have a state that gets initialized in the constructor.

class App extends Component {
  constructor(props) {
    super(props)
    this.state = { count: 0 }
  }

  render() {
    // ...
  }
}

Related questions

0 votes
asked Jul 2, 2019 in ReactJS by Venkatshastri
0 votes
asked Jul 2, 2019 in ReactJS by Venkatshastri
...