src/jsフォルダにindex.ios.jsファイルを保存し、次のコマンドを使用してパッケージマネージャを起動し、xcodeを使用してプロジェクトを実行します。react-native Unhandled JS Exception:index.ios.jsのデフォルトの場所を変更したときのTypeError
npm run start -- --root=./src/js
エラーが発生しました。このタイプのエラーの理由とその解決方法は何ですか?コードの詳細である
index.ios.js
'use strict';
import React from 'react';
import {
AppRegistry,
StyleSheet,
NavigatorIOS,
} from 'react-native';
import Login from './../../app/components/login/Login';
export default class Hello extends React.Component {
render() {
return (
<NavigatorIOS ref="nav"
itemWrapperStyle={styles.navWrap}
style={styles.nav}
initialRoute={{
title: "Login",
component: Login
}}/>
);
}
}
var styles = StyleSheet.create({
navWrap: {
flex: 1,
marginTop: 70,
},
nav: {
flex: 1,
backgroundColor: '#48BBEC'
}
});
AppRegistry.registerComponent('Hello',() => Hello);
.bablerc
{
"presets": [
"react-native"
]
}
index.ios.jsファイルを投稿できますか。 –
確かに、index.ios.jsファイルを追加しました。 – joy
エクスポートのデフォルトを削除して再実行してください。 –