首页 > 解决方案 > 如何使用 React Native PropTypes 和 ESLint 为 Text 正确键入样式道具

问题描述

我正在尝试按照该答案styles: Text.propTypes.style中的建议使用。

但是 ESlint 抱怨:

ESLint: Using `propTypes` from another component is not safe because they may be removed in production builds (react/forbid-foreign-prop-types)

解决这个问题的正确方法是什么?

标签: reactjsreact-proptypes

解决方案


推荐阅读