Skip to content

Instantly share code, notes, and snippets.

@dbilgili
Last active December 12, 2018 19:54
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 dbilgili/7f441e3dd08e60e41982d1accadf7b07 to your computer and use it in GitHub Desktop.
Save dbilgili/7f441e3dd08e60e41982d1accadf7b07 to your computer and use it in GitHub Desktop.
// vim: syntax=JSX
constructor(){
super()
this.selectedElement = React.createRef()
}
render(){
const { children, open } = this.props
return React.cloneElement(children, {ref: this.selectedElement, onClick: open})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment