facebook / prop-types

Runtime type checking for React props and similar objects
MIT License
4.48k stars 358 forks source link

Readme to Function Components #393

Closed levinuncu closed 1 year ago

levinuncu commented 1 year ago

Since its recommend to define components as functions instead of classes this should be updated.

ljharb commented 1 year ago

Where is that unconditionally recommended?

ErrorBoundary components still must be class components, and there's a number of patterns that remain clearer/cleaner as class components than SFCs with hooks.

levinuncu commented 1 year ago

Its recommended in the official react docs: “We recommend to define components as functions instead of classes.“ https://beta.reactjs.org/reference/react/Component

ljharb commented 1 year ago

Once those docs are out of beta, this seems like a reasonable change.

wojtekmaj commented 1 year ago

Well, docs are now out of beta. What do we do?