0
Follow
4
View

propTypes should be a func console warning when passing in array of icons

dumingwei82 注册会员
2023-01-26 04:51

change your proptypes to this

Button.propTypes = {
  type: PropTypes.string.isRequired,
  label: PropTypes.string.isRequired,
  icon: PropTypes.oneOf(Object.keys(HIcons)),
  variant: PropTypes.oneOf(['sm', 'md', 'lg'])
};

you mistakely write this one :

icon: PropTypes.oneOf[Object.keys(HIcons)],

About the Author

Question Info

Publish Time
2023-01-26 04:51
Update Time
2023-01-26 04:51

Related Question