Journal

A kick-off video chat for Product Lab is scheduled for early tomorrow morning, so I’ll need to wrap things up early tonight and head to bed at a reasonable time, lest I sleep right through the call!

My objective today is to continue with my React Hooks learning from yesterday. Looking at my schedule, actual code may fall back to tomorrow or Saturday.

I read a few different articles and then started back into the 1-hour introduction class to React Hooks (which is decidedly not 1 hour if you’re trying to take notes and do the challenges as you go).

One really interesting concept proposed in the React Hooks course was both reusing values within hooks and using the return statement to clean them up:

useEffect(() => {
  let timeoutId
  const handleResize = () => {
    setWindowSize([window.innerWidth, window.innerHeight])
    setVisible(true)
    clearTimeout(timeoutId)
    timeoutId = setTimeout(() => setVisible(false), 500)
  }
  window.addEventListener('resize', handleResize)
  return () => window.removeEventListener('resize', handleResize)
}, [])

I also encountered the Rules of Hooks, and saw that the page contains an ESLint plugin to enforce the rules, which may be neat to try on my portfolio site when I rebuild it.

The day went by incredibly fast and I can’t believe I’m already past when I said I’d head to bed! I’m excited to meet my teammates for Product Lab in the morning!

Tasklist

  • Post my daily updates on Product Lab
  • Post my daily updates on the TD Collection discord
  • Look into React Hooks
    • Complete React Progression item #7
    • Complete React Progression item #8
  • Work on TDC Landing Page layout
  • Push commit of updated layout and routing with main app scaffolding, short-circuit “GET STARTED” link to Landing, for now