React createRef forwardRef polyfill
npm install react-polyfill-refreact-polyfill-ref> Polyfill for React new ref api
>= react@0.14.9
``jsx
import { createRef, forwardRef } from 'react-polyfill-ref';
const ref = createRef();
function App() {
return (
// forwardRef
const ref = createRef();
const Input = forwardRef((props, ref) => {
return
});
const App = () => {
return (
For more usage, see
You can use it with react-polyfill-context and react-polyfill-hooks