Document Controlled vs Uncontrolled Component Design pattern
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 11.8k
- Forks
- 7.9k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 11
Description
pursuant to this discussion https://twitter.com/dan_abramov/status/1001943857096003584
all react components can be:
- controlled (no internal state)
- uncontrolled (internal state)
- mixed (uncontrolled by default, unless some props are passed to make it controlled)
the current docs on controlled vs uncontrolled: https://reactjs.org/docs/uncontrolled-components.html focus entirely on forms, but this design pattern applies to -all- components. we should document this.
questions
- What else should we say in the docs?
- do we want to tell people that they can do "mixed control" or do we leave that for people to discover for themselves?
- is this the same page as https://reactjs.org/docs/uncontrolled-components.html or is it a separate page?
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
Start with the existing uncontrolled-components.html documentation and the linked discussion. Resolve whether controlled, uncontrolled, and mixed component patterns belong on that page or a separate page, and determine the guidance the documentation should provide. Done means the selected documentation clearly covers the pattern beyond forms and answers the open scope questions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100