-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
58 lines (50 loc) · 1.67 KB
/
index.js
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/**
* @format
*/
// import { AppRegistry } from 'react-native';
// import App from './App';
// import { name as appName } from './app.json';
// AppRegistry.registerComponent(appName, () => App);
import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { AppRegistry } from 'react-native';
import Notes from './src/screens/Notes/Notes';
import { name as appName } from './app.json';
import { createStore, applyMiddleware } from 'redux';
import createSagaMiddleware from 'redux-saga';
import { Provider } from 'react-redux';
import reducers from './src/core/reducers/root';
import rootSaga from './src/core/sagas/root';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { NoteEditor } from './src/screens/NoteEditor/NoteEditor';
const Stack = createNativeStackNavigator();
let composeWithDevTools = middlewareToCompose => middlewareToCompose;
if (__DEV__) {
composeWithDevTools = require('redux-devtools-extension').composeWithDevTools;
}
const sagaMiddleware = createSagaMiddleware();
const store = createStore(
reducers,
composeWithDevTools(applyMiddleware(sagaMiddleware)),
);
sagaMiddleware.run(rootSaga);
const App = () => (
<NavigationContainer>
<Provider store={store}>
<Stack.Navigator>
<Stack.Screen
name="Notes"
component={Notes}
options={{ title: 'My Notes' }}
/>
<Stack.Screen
name="NoteEditor"
component={NoteEditor}
options={{ title: 'Note Editor' }}
/>
</Stack.Navigator>
{/* <Notes /> */}
</Provider>
</NavigationContainer>
);
AppRegistry.registerComponent(appName, () => App);