第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

導(dǎo)入react-native運(yùn)行就報(bào)錯(cuò),急求老師指點(diǎn),謝謝!

[error][tid:com.facebook.react.JavaScript] Seems you're trying to access 'ReactNative.createClass' from the 'react-native' package. Perhaps you meant to access 'React.createClass' from the 'react' package instead?


For example, instead of:


? import React, { Component, View } from 'react-native';


You should now do:


? import React, { Component } from 'react';

? import { View } from 'react-native';


Check the release notes on how to upgrade your code - https://github.com/facebook/react-native/releases/tag/v0.25.1

請(qǐng)問(wèn)老師:我通過(guò)require導(dǎo)入react-native的時(shí)候報(bào)錯(cuò),使用以下方式的時(shí)候正常:

import React, { Component } from 'react';

import {

? AppRegistry,

? StyleSheet,

? View,

? PixelRatio,

? Text,

} from 'react-native';


正在回答

5 回答

這個(gè)是版本的問(wèn)題,我在ES5寫(xiě)的項(xiàng)目中使用ES6寫(xiě)法導(dǎo)致的。

0 回復(fù) 有任何疑惑可以回復(fù)我~

React Native的代碼不能直接粘貼過(guò)來(lái),ReactJS用的是HTML標(biāo)簽,React Native用的是XML標(biāo)簽,并且ReactJS not ? AppRegistry,StyleSheet,Text,View,TouchableHighlight,ToastAndroid....................

0 回復(fù) 有任何疑惑可以回復(fù)我~

HI, 我也遇到相同的問(wèn)題

代碼如下:

import React, {Component,PropTypes} from 'react';
import {
?AppRegistry,
?StyleSheet,
?Text,
?View,
?TouchableHighlight,
?ToastAndroid,
} from 'react-native';

var {NativeModules} = require('react-native');


0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

NiNe3

我沒(méi)解決啊,,怎么弄得啊是不是版本問(wèn)題?
2016-10-22 回復(fù) 有任何疑惑可以回復(fù)我~

我也遇到這個(gè)問(wèn)題了,怎么解決啊

0 回復(fù) 有任何疑惑可以回復(fù)我~

沒(méi)明白你的具體問(wèn)題,像下面這種寫(xiě)法是ES6的,現(xiàn)在react-native用的都是ES6的寫(xiě)法。具體相關(guān)寫(xiě)法你應(yīng)該查查ES6

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消
React入門(mén)
  • 參與學(xué)習(xí)       122096    人
  • 解答問(wèn)題       126    個(gè)

顛覆式前端UI開(kāi)發(fā)框架React入門(mén)視頻教程,趕緊學(xué)起來(lái)

進(jìn)入課程

導(dǎo)入react-native運(yùn)行就報(bào)錯(cuò),急求老師指點(diǎn),謝謝!

我要回答 關(guān)注問(wèn)題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)