Skip to content

Commit 461b93c

Browse files
fix(instructions): Explain that react-hooks 02.01 should be broken
> in the useEffect callback, subscribe to window's popstate event If a dev knows how to use `useEffect()` this will look like a bug... because it is. Let's explain that this bug is supposed to be here at this point.
1 parent ab3e498 commit 461b93c

File tree

1 file changed

+2
-2
lines changed
  • exercises/02.side-effects/01.problem.effects

1 file changed

+2
-2
lines changed

exercises/02.side-effects/01.problem.effects/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ function App() {
1818
const caterpillarChecked = words.includes('caterpillar')
1919

2020
// 🐨 add a useEffect(() => {}, []) call here (we'll talk about that empty array later)
21-
// 🐨 in the useEffect call, subscribe to window's popstate event
22-
// 🐨 in the useEffect callback, unsubscribe from window's popstate event
21+
// 🐨 in the useEffect callback, subscribe to window's popstate event
22+
// 🐨 if that doesn't make sense to you... don't worry, it's supposed to be broken!
2323
// 🐨 your event handler should call setQuery to getQueryParam()
2424
// 📜 https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener
2525

0 commit comments

Comments
 (0)