Skip to content

Instantly share code, notes, and snippets.

@xettri
Created November 7, 2019 22:58
Show Gist options
  • Save xettri/a704edf74cad672e2a642da6f0264f18 to your computer and use it in GitHub Desktop.
Save xettri/a704edf74cad672e2a642da6f0264f18 to your computer and use it in GitHub Desktop.
import React, { Component } from 'react';
import {connect} from "react-redux";
class App extends Component {
constructor(props){
super(props);
this.state = {}
}
componentWillMount(){
}
render(){
return (
<>
<h1>Hello Its Working</h1>
</>
)
}
}
const mapStateToProps = state => {
return {
data: state.notifyReducer.data
}
}
const mapDispatchToProps = dispatch => {
return{
abc : (val)=> dispatch({ type: 'SHOW_NOTIFY',payload:val,dispatch : dispatch}),
bcd : (val)=> dispatch({ type: 'CLEAR_NOTIFYss',payload:val,dispatch : dispatch})
}
}
export default connect(mapStateToProps,mapDispatchToProps)(App)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment