Похожие чаты

Anyone using react with typescript? Are propTypes and typescript types

(React.FC<>) used at the same time as they are somewhat similar.

2 ответов

17 просмотров

PropTypes are for defining run-time prop rules. I omit them for now and do only build time checking with ts (React.FC<>) Afaik both work together

Misan
PropTypes are for defining run-time prop rules. I ...

Yeah both work together. I came to know that one can generate types from propTypes in newer version of react https://blog.logrocket.com/comparing-typescript-and-proptypes-in-react-applications/

Похожие вопросы

Обсуждают сегодня

Карта сайта