-
Notifications
You must be signed in to change notification settings - Fork 45.9k
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
React.Component undocumented templated class #9684
Comments
Could you please point me to the internal source file that defines |
It's in Flow codebase, weirdly: https://github.com/facebook/flow/blob/master/lib/react.js#L16. I guess this is because React codebase is yet only partially typed |
Strange thing. Thank you very much! I will try to work on a PR to update the documentation. It's pretty confusing when you try to get deeper into React |
React documentation doesn't have a section about Flow (should it?) So I am not fully sure where you would like to document this. However, there is a section about React on the Flow website. Does it not help? |
@gaearon the section about React on the Flow website is a guide and it does not present the entire API reference. And yes, I think React should have a section about Flow. Currently, the React docs section Typechecking with PropTypes explains that
In my opinion this comes as a way to encourage the usage of TypeScript or Flow for static typechecking. Hence, this is part of the reason why there should be a Flow section in the React documentation. What do you think? |
The wording on React doc is really unfortunate. It shouldn't say "deprecated", it should say "moved". We're not deprecating PropTypes—just moving them to a separate package. Although I agree that in general we think Flow/TS is a better way to do it. I'm open to having a new guide called "Static Type Checking" here that shows how to use React from Flow and from TypeScript, and describes main API definitions. Would you like to work on it? |
@gaearon, yes, I would like to help as much as I can! |
Thank you for filing this issue! 😄 The documentation and source code for reactjs.org now lives in a different repository: reactjs/reactjs.org. (For more info on why we made this move, see issue #11075.) I've moved your issue to the new repo: reactjs/react.dev#76 Let's continue the discussion there! Sorry for the inconvenience. |
I see that
React.Component
is used with three template parameters that are documented nowhere. (or I simply couldn't find the docs).I was able to deduce that the second and third are the types of
props
andstate
respectively. However, I coudn't figure it out about the first template parameter.Are these documented anywhere, please?
The text was updated successfully, but these errors were encountered: