【发布时间】:2016-09-01 11:03:02
【问题描述】:
有人可以建议如何删除第三方警告吗? https://facebook.github.io/react/warnings/dont-call-proptypes.html
我不知道如何实现以及将官方文档中提到的代码放在哪里。 他们从 react-bootstrap 获取代码
export default function deprecated(propType, explanation) {
return function validate(props, propName, componentName) {
if (props[propName] != null) {
const message = `"${propName}" property of
"${componentName}" has been deprecated.\n${explanation}`;
if (!warned[message]) {
warning(false, message);
warned[message] = true;
}
}
return propType(props, propName, componentName);
};
}
请逐步写出解决第三方警告的步骤。
谢谢
【问题讨论】:
标签: javascript reactjs react-native react-router