加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

react-native – 手动调用React.PropTypes验证React native“^ 0

发布时间:2020-12-15 06:35:46 所属栏目:百科 来源:网络整理
导读:我已升级到最新版本的React / RN: “react”:“^ 15.2.1”, “react-native”:“^ 0.30.0”, 我开始收到很多关于样式表的警告。我实际上没有使用React.PropTypes验证的样式表,那么为什么抛出这些警告? const styles = StyleSheet.create({ welcome: {
我已升级到最新版本的React / RN:
“react”:“^ 15.2.1”,
“react-native”:“^ 0.30.0”,

我开始收到很多关于样式表的警告。我实际上没有使用React.PropTypes验证的样式表,那么为什么抛出这些警告?

const styles = StyleSheet.create({
    welcome: {
        fontSize: 20,textAlign: "center",margin: 10,},

ExceptionsManager.js:76 Warning: You are manually calling a
React.PropTypes validation function for the fontSize prop on
StyleSheet welcome. This is deprecated and will not work in the next
major version. You may be seeing this warning due to a third-party
PropTypes library. See 07000
for details.reactConsoleError @

ExceptionsManager.js:76 Warning: You are manually calling a
React.PropTypes validation function for the textAlign prop on
StyleSheet welcome. This is deprecated and will not work in the next
major version. You may be seeing this warning due to a third-party
PropTypes library. See 07000

ExceptionsManager.js:76 Warning: You are manually calling a
React.PropTypes validation function for the margin prop on
StyleSheet welcome. This is deprecated and will not work in the next
major version. You may be seeing this warning due to a third-party
PropTypes library. See 07000
for details.

反应原性0.30取决于反应15.2.0而不是15.2.1。所以你应该做rm -rf node_modules / react,从package.json中删除react版本,然后npm install –save react@15.2.0。这应该做的伎俩。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读