We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7e04002 commit 0c0378cCopy full SHA for 0c0378c
src/App.js
@@ -0,0 +1,26 @@
1
+import {connect} from 'react-redux';
2
+import MyComponent from './myComponent';
3
+
4
+function mapStateToProps(state,ownProps) {
5
+ console.log(state)
6
+ console.log(ownProps)
7
+ return {text: state.text, name: state.name}
8
+}
9
10
+function mapDispatchToProps(dispatch) {
11
+ return {
12
+ onChange: (e) => {
13
+ console.log(dispatch)
14
+ console.log(e)
15
+ dispatch({type: 'change', payload: e})
16
+ }
17
18
19
20
21
+const App = connect(
22
+ mapStateToProps,
23
+ mapDispatchToProps
24
+)(MyComponent);
25
26
+export default App;
0 commit comments