Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

useEffect

  useEffect(() => {
    alert('Requested data from server...');
    get(forecastType).then((response) => {
      setData(response.data);
    });
  }, [forecastType]);
Source by it.reactjs.org #
 
PREVIOUS NEXT
Tagged: #useEffect
ADD COMMENT
Topic
Name
8+6 =