Answers for "await in react in function component"

2

await in react in function component

const here = async () => {
	console.log("here we go");
}
Posted by: Guest on June-09-2021
0

async await class component react

async componentDidMount() {
    // when react first renders then it called componentDidMount()
    const response = await fetch('https://jsonplaceholder.typicode.com/users');
    const json = await response.json();
    console.log(json);
  }
Posted by: Guest on October-21-2020

Code answers related to "await in react in function component"

Code answers related to "Javascript"

Browse Popular Code Answers by Language