mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Merge pull request #5609 from vitorbal/patch-1
Clarify usage of `.propTypes` when using functional components
This commit is contained in:
commit
bb084eba24
1 file changed
+1
@@ -249,6 +249,7 @@ ReactDOM.render(<HelloMessage name="Sebastian" />, mountNode);
|
||||
```
|
||||
|
||||
This simplified component API is intended for components that are pure functions of their props. These components must not retain internal state, do not have backing instances, and do not have the component lifecycle methods. They are pure functional transforms of their input, with zero boilerplate.
|
||||
However, you may still specify `.propTypes` and `.defaultProps` by setting them as properties on the function, just as you would set them on an ES6 class.
|
||||
|
||||
> NOTE:
|
||||
>
|
||||
|
||||
Reference in new issue
Block a user