Я получаю сообщение об ошибке только на iOS:
TypeError: undefined is not an object (evaluating 'this._callListeners.bind')
This error is located at:
in DrawerLayout (at DrawerView.js:161)
...
Зависимости проекта:
"dependencies": {
"@babel/runtime": "7.2.0",
"@babel/plugin-proposal-async-generator-functions": "7.2.0",
"@babel/plugin-proposal-class-properties": "7.2.1",
"@babel/plugin-proposal-object-rest-spread": "7.2.0",
"babel-preset-expo": "5.0.0",
"expo": "31.0.2",
"expo-cli": "2.5.0",
"native-base": "2.8.1",
"react": "16.6.3",
"react-native": "0.57.8",
"react-redux": "6.0.0",
"react-navigation": "3.0.8",
"react-native-vector-icons": "6.1.0",
"redux": "4.0.1"
}
Это началось, когда я начал использовать реагировать на навигацию;но прекрасно работает на Android.
Вот код, в котором мы используем реагирующую навигацию, это основное приложение, в которое импортируются экраны Home и Settings:
//imports...
const routes = {
Home: Home,
Settings: Settings
};
const AppNavigator = createDrawerNavigator(routes);
const AppContainer = createAppContainer(AppNavigator);
export default class App extends React.Component {
state = {}
render() {
if (this.state.isReady) {
return (
<AppContainer/>
);
}
else {
return (<Container><Spinner/></Container>);
}
}
componentWillMount() {
this._loadAssets();
}
async _loadAssets() {
await Expo.Font.loadAsync({
Roboto: require("native-base/Fonts/Roboto.ttf"),
Roboto_medium: require("native-base/Fonts/Roboto_medium.ttf")
});
this.setState({ isReady: true });
}
}