国产成人精品久久免费动漫-国产成人精品天堂-国产成人精品区在线观看-国产成人精品日本-a级毛片无码免费真人-a级毛片毛片免费观看久潮喷

您的位置:首頁技術文章
文章詳情頁

javascript - react-native在chrome調試工具中出現警告,并且不能使用react dev-tools

瀏覽:163日期:2022-11-05 15:08:56

問題描述

1.我使用react@16.0.0-alpha.12, react-native@0.45.1 ,在模擬是可以正常使用的,但是在chrome調試工具中出現了警告:

ExceptionsManager.js:71 Warning: PropTypes has been moved to a separate package. Accessing React.PropTypes is no longer supported and will be removed completely in React 16. Use the prop-types package on npm instead. (https://fb.me/migrating-from-react-proptypes)

ExceptionsManager.js:71 Warning: React.createClass is no longer supported. Use a plain JavaScript class instead. If you’re not yet ready to migrate, create-react-class is available on npm as a drop-in replacement. (https://fb.me/migrating-from-react-create-class)

并且不能使用react dev-tools 進行調試

我的代碼:

/** * Sample React Native App * https://github.com/facebook/react-native * @flow */import React, { Component } from ’react’import { AppRegistry, View, Text, StyleSheet} from ’react-native’export default class second extends Component{ render () { return ( <View style={{ flex: 1,flexDirection: ’column’,justifyContent: ’center’,alignItems: ’center’,backgroundColor: ’ghostwhite’ }}><Text style={{fontSize: 28, color: ’cadetblue’}}>class extends</Text> </View> ) } componentDidMount () { console.log(’==========’) this.testConsolelog() } testConsolelog () { console.log(’e3423423432’) }}const styles2 = StyleSheet.create({ bigblue: { color: ’blue’, fontWeight: ’bold’, fontSize: 30, }, red: { color: ’red’, },});AppRegistry.registerComponent(’second’, () => second);

問題解答

回答1:

你用的react16中,已經棄用了React.createClass這個方法。

因此react16的版本就無法通過該方法來創建組件了。你必須使用ES6的方式來創建組件了。

class Test extends React.Component { ...}

如果你的代碼中用了mixins而必須使用createClass的話,你需要單獨引入另外一個工具庫。

var createReactClass = require(’create-react-class’);

另外,React.propTypes也不能使用了,你想要檢測props,react16中需要引入一個單獨的工具。

import PropTypes from ’prop-types’;回答2:

不能使用react dev-tools, 是不是沒有勾選允許訪問文件地址

javascript - react-native在chrome調試工具中出現警告,并且不能使用react dev-tools

標簽: JavaScript
主站蜘蛛池模板: 精品一区二区三区三区 | 成人在线a | 久久久黄色大片 | 亚洲最大情网站在线观看 | 97在线观看免费版 | 欧美成人性色大片在线观看 | 久久综合色播 | 国产成人亚洲精品无广告 | 国产精品久久久久久久久 | 精品亚洲福利一区二区 | 亚洲国产在 | 欧美成人性色xxxx视频 | 欧美激情亚洲一区中文字幕 | 国产精品视频久久久久 | 成人久久精品一区二区三区 | 久久成人毛片 | 色国产精品 | 成人自拍小视频 | 精品久久久久久久 | 久久久久视频精品网 | 黄到让你下面湿的视频 | 男人的天堂亚洲 | 一级毛片日韩 | 欧美日韩国产免费一区二区三区 | 国产亚洲高清视频 | 国产一区二区精品在线观看 | free性欧美嫩交 | 美女扒开腿让男人桶个爽 | 亚洲九九视频 | avove旗袍丝袜高跟啪啪 | 亚洲精品国产第一区二区三区 | 欧美大片一区二区三区 | 欧美一区二区视频 | 久久久久久免费播放一级毛片 | 一级片免费视频 | 国产精选经典三级小泽玛利亚 | 亚洲一级毛片在线播放 | 在线观看 一区 | 亚洲精品www久久久久久久软件 | 国产成人午夜精品影院游乐网 | 国产91会所洗浴女技师按摩 |