Skip to content

Commit 3b0f2c7

Browse files
fix(instructions): react-hooks 02.01 (#239)
* fix(instructions): react-hooks 02.01 Exercise `react-hooks/exercises/02.side-effects/01.problem.effects/index.tsx` The current instructions don't make sense... this patch clears things up. * 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. * Apply suggestions from code review --------- Co-authored-by: Kent C. Dodds <[email protected]>
1 parent 4d9f475 commit 3b0f2c7

File tree

1 file changed

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

1 file changed

+1
-0
lines changed

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

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ function App() {
1919

2020
// 🐨 add a useEffect(() => {}, []) call here (we'll talk about that empty array later)
2121
// 🐨 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! We'll fix it next
2223
// 🐨 your event handler should call setQuery to getQueryParam()
2324
// 📜 https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener
2425

0 commit comments

Comments
 (0)