Basic React Hooks explained
.png)
What are React Hooks? The preferred way to create components in React nowadays are functional components. React Component often have an inner state. They show an image or a text or other UI elements depending on user actions. User actions like clicking a button can change the inner state of a component. In the early days using "evil" 🙃 class components it was easy to hold the state within the component. You had a "state" class property and a "setState" class method to change the state. import React,{Component} from 'react'; class App extends Component { constructor(){ super() // Here I set sth. in my state this.state={ text : 'Welcome to Barbarian Developer' } } private sayGoodbye(){ // here I modify my component state this.setState({ text:'Bye Bye Earthling' }) } render() { return ( <div> <h1>{this.state.text}</h1> ...