Proptypes for custom react hooks

后端 未结 4 864
长情又很酷
长情又很酷 2021-01-04 00:36

With react hooks coming, should we use prop-types for React custom hooks e.g,

import React from \'react\';
import PropTypes from \'prop-types\';    

const u         


        
4条回答
  •  误落风尘
    2021-01-04 01:03

    In my opinion, using some kind of type mechanism would be better like TypeScript but if you don't you should still use propTypes and additionally you can check this course out from kentcdodds to be sure about propTypes usage https://egghead.io/courses/simplify-react-apps-with-react-hooks

提交回复
热议问题