An open API service indexing awesome lists of open source software.

https://github.com/catamphetamine/react-create-ref

React.createRef() polyfill
https://github.com/catamphetamine/react-create-ref

Last synced: 3 months ago
JSON representation

React.createRef() polyfill

Awesome Lists containing this project

README

        

`React.createRef()` polyfill for React < 16.3

Install
=======

```sh
npm install react-create-ref --save
```

Use
===

Calls native `React.createRef()` if it's available (React >= 16.3), calls the polyfill function otherwise (React < 16.3).

```js
import createRef from 'react-create-ref'

class Example extends React.Component {
constructor() {
this.input = createRef()
}

render() {
return (


this.input.current.focus()} />

)
}
}
```