Skip to content

Instantly share code, notes, and snippets.

@barberdt
Created August 10, 2015 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barberdt/16721e107a55b8b98227 to your computer and use it in GitHub Desktop.
Save barberdt/16721e107a55b8b98227 to your computer and use it in GitHub Desktop.
const MyFunctionalityComponent = React.createClass({
myFunctionalityMethod() {
// do some functionality
}
render() {
if (isMobile) {
return <MyMobileComponent onInteraction={this.myFunctionalityMethod} />
} else {
return <MyDesktopComponent onInteraction={this.myFunctionalityMethod} />
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment