Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用 PropTypes 检查类型 无效,需要手动调用PropTypes.checkPropTypes #4661

Open
936446507 opened this issue Oct 23, 2019 · 1 comment
Labels
V-1 Version - 1.x

Comments

@936446507
Copy link

936446507 commented Oct 23, 2019

问题描述

使用 PropTypes 检查类型 无效,需要手动调用PropTypes.checkPropTypes

使用版本

v1.3.19

目前使用代码

import Taro, { Component as XComponent } from '@tarojs/taro'
import PropTypes from 'prop-types'
Taro.Component = class Component extends XComponent {
  constructor(...args) {
    super(...args)
    PropTypes.checkPropTypes(this.constructor.propTypes, this.props, 'props', this.constructor.name);
  }
}
@taro-bot
Copy link

taro-bot bot commented Oct 23, 2019

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
V-1 Version - 1.x
Projects
None yet
Development

No branches or pull requests

2 participants