Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document defaultProps in README #343

Closed
scott-ln opened this issue Apr 13, 2021 · 5 comments
Closed

Document defaultProps in README #343

scott-ln opened this issue Apr 13, 2021 · 5 comments

Comments

@scott-ln
Copy link

defaultProps are not mentioned at all in the README. This is not useful if you've just gotten an error from eslint-plugin-react/require-default-props. The top Google hit for "React defaultProps" is this page on the React site which directs you to look at the prop-types documentation instead.

@ljharb
Copy link
Collaborator

ljharb commented Apr 13, 2021

A sentence that points back to https://reactjs.org/docs/typechecking-with-proptypes.html#default-prop-values seems reasonable.

@scott-ln
Copy link
Author

scott-ln commented Apr 14, 2021

Just looked at that page again and I see now that the message at the top which I mentioned is intended for people who were using the old React.PropTypes. That wasn't clear to me as a new user encountering an important-looking yellow box at the start of the page, so perhaps it could be moved a little further down the page.

@ljharb
Copy link
Collaborator

ljharb commented Apr 14, 2021

I have no control over react’s docs; you’d have to file an issue/PR on react itself for that.

@scott-ln
Copy link
Author

Gotcha, will do - thanks Jordan.

@ljharb
Copy link
Collaborator

ljharb commented Dec 22, 2021

Closing in favor of reactjs/react.dev#3632

@ljharb ljharb closed this as completed Dec 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants