part 2: React class components

0 40
Avatar for yara
Written by
4 years ago

In part 1 we talked about React functional component and why we do components in this part we will talk about react class components

Class components are typically used when there is more advanced user interactions, like forms

All class components need to extend the React.Component class so we can write our function component to a class now

class Hello extends 
React.Component {
  render() {
   return <h1> helloo read.cash </h1>;
  }
}

Class components need to have a render method like in the above code block to tell the page what should show

16
$ 0.08
$ 0.08 from @TheRandomRewarder

Comments