Created
September 15, 2017 17:05
-
-
Save Bastiani/3099e79e8d188cc8eef824ac3883ea35 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component } from 'react'; | |
import { connect } from 'react-redux'; | |
import * as actions from './actions'; | |
let createHandlers = function(dispatch) { | |
let onClick = function(node, data) { | |
dispatch(actions.nodeClicked(data)) | |
}; | |
return { | |
onClick, | |
// other handlers | |
}; | |
} | |
class Controls extends Component { | |
constructor(props) { | |
super(props); | |
this.handlers = createHandlers(this.props.dispatch); | |
} | |
render() { | |
// pass this.handlers anywhere you'd like | |
} | |
} | |
export default connect()(Controls); |
Mais um comentário, react native, djskfh ksdjfhk sjdfh ksjdfhk sdjfh ksdjfh ksdfjhs kfj shkdfj hskfj ksdfjh skdjfh skjfhk sdjfhk sjfskdjf hskfj hsdkfj shkdfj shdfkj dsfh jds hfkdsjf hskdjf hkdsfj hksdfj hdksj hfkdj hfks jfhksdjfh ksdjfhks djfhk sdjfh ksdj fhksdjfh
teste devgrid, linux, react-native
DEVGRID Test, Rafael Campos de Bastiani
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Teste app, DEVGRID React Native