# react-create-ref

> React.createRef() polyfill

Latest version **1.0.1** (published 2019-01-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-create-ref
pnpm add react-create-ref
yarn add react-create-ref
bun add react-create-ref
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2019-01-04 |
| First published | 2018-07-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | catamphetamine |
| Maintainers | catamphetamine |
| Keywords | react, createref, create, ref, polyfill |

## Links

- npm: https://www.npmjs.com/package/react-create-ref
- Repository: https://github.com/catamphetamine/react-create-ref
- Homepage: https://github.com/catamphetamine/react-create-ref#readme
- Issues: https://github.com/catamphetamine/react-create-ref/issues
- npm.io page: https://npm.io/package/react-create-ref

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2019-01-04
- 1.0.0 — 2018-07-27

## 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 (
      <form>
        <input type="text" ref={this.input} />
        <button type="button" onClick={() => this.input.current.focus()} />
      </form>
    )
  }
}
```

---
_Source: https://npm.io/package/react-create-ref · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
