亚洲精品久久久中文字幕-亚洲精品久久片久久-亚洲精品久久青草-亚洲精品久久婷婷爱久久婷婷-亚洲精品久久午夜香蕉

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

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

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

問(wèn)題描述

1.我使用[email protected][email protected] ,在模擬是可以正常使用的,但是在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);

問(wèn)題解答

回答1:

你用的react16中,已經(jīng)棄用了React.createClass這個(gè)方法。

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

class Test extends React.Component { ...}

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

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

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

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

不能使用react dev-tools, 是不是沒(méi)有勾選允許訪問(wèn)文件地址

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

標(biāo)簽: JavaScript
主站蜘蛛池模板: 欧美一级在线全免费 | a毛片毛费观看 | 草草青青 | 最新精品视频在线观看 | a免费在线观看 | 免费网站在线观看国产v片 免费网站成人亚洲 | 美女吊黑视频在线观看 | 污污网站免费入口链接 | 久久成年人视频 | 韩国一级特黄清高免费大片 | 日本高清中文字幕一区二区三区 | 亚洲国产色图 | 国产中文字幕视频 | 国产一级爱做片免费观看 | 91亚洲区国产区精品区 | 亚洲欧美在线免费观看 | 亚洲午夜国产精品无卡 | 色偷偷影院| 久久精品午夜视频 | 黄色片免费在线观看视频 | 永久在线播放 | 午夜骚影 | 久久久免费精品视频 | 精品一区二区三区的国产在线观看 | 精品无人区一区二区三区 | 精品久久久在线观看 | 亚洲免费中字慕日产2021 | 午夜国产精品不卡在线观看 | 国产综合成色在线视频 | www看片| 国产成人v视频在线观看 | 深夜在线看片 | 欧美成人精品一区二三区在线观看 | 在线播放成人高清免费视频 | 国产精品入口麻豆免费看 | 国内精品视频成人一区二区 | 精品网站| 一级毛片一级黄片 | 手机看片日韩国产福利视频 | 97视频总站 | 免费一区二区三区在线视频 |