Whether typescript, is used in the react project also needs to use prop-types for format verification.

for example:
whether typescript, is used in the react project also needs to use prop-types for format verification.

Mar.04,2021

you can validate only with typescript, with prop-types only, or with a mix of both, which is not strictly restricted.
first of all, both typescript, and prop-types, are checked in development mode. There is no need to say much about typescript. For react, we refer to the official website:
clipboard.png
typescripttsprop-typesreact:

clipboard.png

clipboard.png
typescript

react

uiant-design

Affix:

clipboard.png

Alert:

clipboard.png

.

required.
PropTypes is a constraint for components to receive prop.

typescript type constraints are mainly parameter passing and return value constraints, the two things focus on different

Menu