反応ネイティブ アプリケーションで stacknavigator を使用する方法を学習しようとしています。しかし、ページ階層のレベル 2 になるとシステムがクラッシュし続け、次のメッセージが表示されます。
次によって管理されるビューのプロパティ 'accessibilityLabel' の更新中にエラーが発生しました: RTCView
私のアプリが行うことは、Region という単語を提示することだけです。[地域] をクリックすると、[一般] という単語が表示されます。General という単語を押すと、空の画面が表示されるはずですが、代わりに、上記のエラーとクラッシュが発生します。
私の単純なプロジェクトのコードは次のとおりです。
index.android.js
import React, { Component } from 'react';
import App from './components/Home';
import {
AppRegistry,
View
} from 'react-native';
export default class myapp extends Component {
render() {
return (
<App />
);
}
}
AppRegistry.registerComponent('myapp', () => myapp);
コンポーネント/Home.js
import React, { Component } from 'react';
import {StackNavigator} from 'react-navigation';
import Regions from './Regions';
import Compatibility from './Compatibility';
import {
AppRegistry,
StyleSheet,
Text,
View,
Linking
} from 'react-native';
class Home extends Component {
static navigationOptions = {
title: 'Login',
headerStyle: {
backgroundColor:'#000000'
},
headerTitleStyle: {
color:'#fff'
}
};
render(){
const {navigate} = this.props.navigation;
return (
<View style={styles.container}>
<Text style={styles.instructions} onPress={()=>navigate('Regions',{realm:'blah'})}>
Regions
</Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});
const myscreens = StackNavigator({
Home: {screen: Home},
Regions:{screen:Regions},
Compatibility:{screen:Compatibility}
});
export default myscreens;
components/Regions.js
import React, { Component } from 'react';
import {StackNavigator} from 'react-navigation';
import {
Text,
View,
FlatList
} from 'react-native';
export default class Regions extends Component {
static navigationOptions = {
title: 'Pick Region',
headerStyle: {
backgroundColor:'#F00'
},
headerTitleStyle: {
color:'#fff'
},
headerTruncatedBackTitle:{
color:'#fff'
},
headerBackTitle:{
color:'#fff'
},
headerBackTitleStyle:{
color:'#fff'
},
headerTruncatedBackTitle:{
color:'#fff'
}
};
constructor(props)
{
super(props);
}
render() {
const {navigate} = this.props.navigation;
let data = [
{regionName:'General',numOfDimensions:2}
];
return (
<FlatList
data={data}
keyExtractor={(item, index) => index}
renderItem={({item}) => <Text onPress={()=>navigate('Compatibility',{item:item})}>{item.regionName}</Text>}
/>
);
}
}
コンポーネント/Compatibility.js
import React, { Component } from 'react';
import {
Text,
View,
FlatList
} from 'react-native';
export default class Compatibility extends Component {
static navigationOptions = {
title: 'Pick Region',
headerStyle: {
backgroundColor:'#F00'
},
headerTitleStyle: {
color:'#fff'
},
headerTruncatedBackTitle:{
color:'#fff'
},
headerBackTitle:{
color:'#fff'
},
headerBackTitleStyle:{
color:'#fff'
},
headerTruncatedBackTitle:{
color:'#fff'
}
};
constructor(props)
{
super(props);
}
render() {
console.log('Compatibility');
return <View></View>;
}
}
私は何を間違っていますか?空の互換性画面を表示して、このクラッシュを解消したいだけです。