Are there two different ways of using State in React?
I just read a resource, and this is one method within a function
const [searchTerm, setSearchTerm] = React.useState(''); setSearchTerm('abc');Another uses this.state property
this.state .. this.setState({ searchTerm: 'abc' // enter values here });
When should I utilize these two methods? I am using React 16 with functions and inquiring about the difference.