Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

async useeffect

const [users, setUsers] = useState([]);
  
useffect(() => {
  const getUsers = async () => {
    let response = await fetch('/users');
    let data = await response.json();
    setUsers(data);
  };
    
 getUsers();
}, []);
Source by dev.to #
 
PREVIOUS NEXT
Tagged: #async #useeffect
ADD COMMENT
Topic
Name
7+8 =