[Suggestion]: Confusing example in UseTransition
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 11.8k
- Forks
- 7.9k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 11
Description
Summary
In UseTransition example, you have used input as DOM control so it's instantly updating quantity, which is confusing as it suppose to wait for server call then we can understand the use of transition there, I don't find this document is useful, all examples are very confusing.
below code would be helpful. Didn't expect this from react doc itself, I feel I have better understanding than who written this doc's.
export default function Item({quantity, onUpdateQuantity}) { function handleChange(event) { onUpdateQuantity(event.target.value); } return ( <div className="item"> <span>Eras Tour Tickets</span> <label htmlFor="name">Quantity: </label> <input type="number" value={quantity} onChange={handleChange} /> </div> ) }
Page
No response
Details
Please update Use Transition example that is related to quantity and total.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open the linked useTransition documentation example, “Perform non-blocking updates with Actions,” and review how the quantity input and total are presented. Compare the proposed Item example with the current flow, then update the quantity-and-total example so the transition’s purpose is clear around the server call. Done means the revised example is understandable and accurately demonstrates the intended transition behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100