Bonjour,
J'utilise react-native pour faire une application android / ios (le mode Hot Reloading est activité).
L'erreur est la suivante :Cette erreur apparaît uniquement lorsque j'effectue une modification sur mon fichier app/index.js :<Provider> does not support changing `store` on the fly. It is most likely that you see this error because you updated to Redux 2.x and React Redux 2.x which no longer hot reload reducers automatically. See https://github.com/reactjs/react-red...ses/tag/v2.0.0 for the migration instructions
Lorsque j'enregistre une modification dans ce fichier, le Hot reloading essaye de reRender le component App, ce qui provoque une erreur.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35 import React, { Component } from 'react'; import { connect, Provider } from 'react-redux'; import { Router, Scene, Actions, ActionConst } from 'react-native-router-flux'; import App from './containers/App'; import configureStore from './config/configureStore'; const store = configureStore(); const RouterWithRedux = connect()(Router); const scenes = Actions.create( <Scene key="root"> <Scene key="App" title="App" initial={true} component={App} hideNavBar={true} type={ActionConst.REPLACE} /> </Scene> ); export default class myApp extends Component { constructor(props) { super(props); } render() { return ( <Provider store={store}> <RouterWithRedux scenes={scenes} /> </Provider> ); } };
Avez-vous une idée de comment je peux corriger ça ?
Mes fichiers index.ios.js et index.android.js ont le même contenu qui est :
Mon package.json :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 import { AppRegistry } from 'react-native'; import App from './app'; AppRegistry.registerComponent('myApp', () => App);Merci."react-native-router-flux": "^3.38.0",
"react-redux": "^5.0.3",
"redux": "^3.6.0",
"redux-thunk": "^2.2.0",
Partager