dailylog 03-01-21 pt 2

less than 1 minute read

RE: Caroline Googlesheets

  1. Is it best to get ALL the data right away and then simply display what I want when clicked?
  2. Should I use useMemo?
  3. How many ‘useEffects’ in one file are too many in one file?

30 second summary:

You don’t need to use a callback with setState – you just need to do a useEffect. This is how I did it (not sure if best practice?)

useEffect(() => {
  const formatAboutData = () => {
    if (aboutData) {
      aboutPhoto = aboutData[1].content['$t'];
      console.log('running NOW', aboutData[1].content['$t']);
    }
  };
  formatAboutData();
}, [aboutData]);