Предупреждение: возможный необработанный отказ от обещания (id: 0)
TypeError: Объект не является функцией (оценивается concreteComponentProvider () ')
ЭтоПредупреждение я получаю после добавления React Redux в свое приложение.Это может привести к конфликту между React Redux и React Native Navigation (последняя версия) или также React Native Vector Icons.
Я думаю, что причина ошибки в этом коде, startMainTabs.js
.Здесь я кодирую всю свою собственную навигацию React.
Не стесняйтесь спрашивать больше моих кодов или любые вопросы.Спасибо!
Вот мои коды: App.js
import {Provider} from 'react-redux';
import configureStore from './src/store/configureStore';
const store = configureStore();
//Register Screens
Navigation.registerComponent("Event.AuthScreen", () => AuthScreen);
Navigation.registerComponent("Event.Map", () => EventMap);
Navigation.registerComponent("EventCreator", () => EventCreator, store, Provider);
Navigation.registerComponent("EventHome", () => EventHome, store, Provider);
Navigation.setRoot({
root: {
stack: {
children: [{
component: {
name: "Event.AuthScreen",
}
}],
options: {
topBar: {
title: {
text: 'Welcome'
}
}
}
}
}
});
startMainTabs.js
const startTabs = () => {
Promise.all([
Icon.getImageSource("ios-home", 30),
Icon.getImageSource("ios-map", 30),
Icon.getImageSource("ios-share-alt", 30)
]).then(sources => {
Navigation.setRoot({
root: {
bottomTabs: {
children: [{
stack: {
children: [{
component: {
name: "Event.Map",
}
}],
options: {
bottomTab: {
icon: sources[1],
testID: 'FIRST_TAB_BAR_BUTTON'
}
}
}
},
{
stack: {
children: [{
component: {
name: "EventHome"
}
}],
options: {
bottomTab: {
icon: sources[0],
testID: 'SECOND_TAB_BAR_BUTTON'
}
}
}
},
{
component: {
name: "EventCreator",
options: {
bottomTab: {
icon: sources[2],
testID: 'THIRD_TAB_BAR_BUTTON'
}
}
}
}
]
}
}
});
})
}