Skip to content

Instantly share code, notes, and snippets.

@Bastiani
Created September 15, 2017 17:05
Show Gist options
  • Save Bastiani/3099e79e8d188cc8eef824ac3883ea35 to your computer and use it in GitHub Desktop.
Save Bastiani/3099e79e8d188cc8eef824ac3883ea35 to your computer and use it in GitHub Desktop.
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);
@Bastiani
Copy link
Author

Teste app, DEVGRID React Native

@Bastiani
Copy link
Author

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

@Bastiani
Copy link
Author

teste devgrid, linux, react-native

@Bastiani
Copy link
Author

DEVGRID Test, Rafael Campos de Bastiani

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment