[Suggestion]: Make better use of ref in the last challenge of the docs
Summary
Remove useless useState and simply use ref
Page
No response
Details
The docs in the 4th challenge suggest using both a useState and a ref for managing the value of a component when there is a delay. This is unnecesarry and we can simply use the ref. https://react.dev/learn/referencing-values-with-refs#challenges
#5485 https://github.com/reactjs/react.dev/pull/5485/files
As someone who is following the Learn React docs in order, I don't think this change is necessary. The current explanation draws a helpful distinction between the appropriate times to use State and Ref. Moreover, the proposed concept has not been introduced up to that point, so it will be confusing to readers. According to the contribution guideline:
Learn React is designed to introduce fundamental concepts in a step-by-step way. Each individual article in Learn React builds on the knowledge from the previous ones, so make sure not to add any "cyclical dependencies" between them. It is important that the reader can start with the first article and work their way to the last Learn React article without ever having to "look ahead" for a definition.