reactjs / reactjs/react.dev

Note on PropTypes docs that directs users to prop-types can be confusing for new users

Open
#3,632 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
11.8k
Forks
7.9k
Avg merge
1d 11h
Merged PRs (30d)
11

Description

I was looking for the docs on how to use defaultProps and found the PropTypes docs. The first thing I saw there was the yellow box at the top that says:

Note:
React.PropTypes has moved into a different package since React v15.5. Please use the prop-types library instead.

I read this as meaning "this page is out of date, please see those docs", especially because the yellow box looks so important, and went to that package, which has much less comprehensive documentation. (Including no mention of defaultProps currently, although that's going to be fixed.) I didn't understand until re-reading it the next day that it was intended for people using PropTypes under its old name and I was supposed to carry on reading the page.

I suspect that I may not be the only learner prone to this kind of misreading, so may I please suggest that you move the note to a little further down the page and possibly tweak the wording? Thank you.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the PropTypes documentation page linked in the issue and inspect how the introductory note is positioned and worded. Done means the note no longer suggests that the page is obsolete, while still directing users of the old React.PropTypes name to the prop-types package.

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
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.