午夜剧场伦理_日本一道高清_国产又黄又硬_91黄色网战_女同久久另类69精品国产_妹妹的朋友在线

您的位置:首頁技術(shù)文章
文章詳情頁

javascript - react-native在chrome調(diào)試工具中出現(xiàn)警告,并且不能使用react dev-tools

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

問題描述

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

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 進(jìn)行調(diào)試

我的代碼:

/** * 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中,已經(jīng)棄用了React.createClass這個(gè)方法。

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

class Test extends React.Component { ...}

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

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

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

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

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

javascript - react-native在chrome調(diào)試工具中出現(xiàn)警告,并且不能使用react dev-tools

標(biāo)簽: JavaScript
主站蜘蛛池模板: www.亚洲| 手机看片日韩av | 国产精品爽爽久久久久久 | 国产h视频 | 日韩精品免费视频 | 日韩成人精品一区 | 亚洲一区国产精品 | 网爆门在线观看 | 狠狠操伊人| 91久久国产精品 | 午夜男人网站 | 好吊色视频一区二区 | 国产三级一区二区 | 欧美黑人性猛交xxx 国产婷婷一区二区 | 国产精品久久久网站 | 日韩经典一区 | 亚洲综合中文字幕在线 | 992tv成人免费观看 | 粉嫩av一区二区三区四区五区 | 亚洲丝袜在线观看 | 天天舔天天干天天操 | 亚洲激情视频网 | 亚洲一区二区在线播放 | 久久久久久久久免费 | 色综合一区二区 | 狠狠爱天天干 | 欧美午夜不卡 | 久草黄色| 在线观看国产黄色 | 日韩二区在线 | 69xxx少妇按摩视频 | 亚洲天堂免费 | 日韩免费一区二区三区 | 尹人在线观看 | 狠狠操狠狠 | 奶波霸巨乳一二三区乳 | 国产大奶 | 国产精品久久一区二区三区 | 一区二区三区视频免费在线观看 | 伊人av一区 | 成人小视频在线播放 |