Skip to content

Instantly share code, notes, and snippets.

@ryanflorence
Last active October 5, 2016 15:43
Show Gist options
  • Save ryanflorence/76e3c31e91d4dc3b7073bfd07728e6a0 to your computer and use it in GitHub Desktop.
Save ryanflorence/76e3c31e91d4dc3b7073bfd07728e6a0 to your computer and use it in GitHub Desktop.
class AccessibleMatch extends React.Component {
componentDidMount() {
this.node.focus()
}
render() {
const { component:Component, ...rest } = this.props
return <div ref={n => this.node = n} tabIndex="-1"><Component {...rest}/></div>
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment