Skip to content

Latest commit

 

History

History
101 lines (89 loc) · 1.42 KB

README.md

File metadata and controls

101 lines (89 loc) · 1.42 KB

react-polyfills

React/Rax polyfills for ref, context and hooks

usage

React

version < v16.3

import {
  // memo
  memo,
  // ref
  createRef,
  forwardRef,
  // Fragment
  Fragment,
  // PureComponent
  PureComponent,
  // portal
  createPortal,
  // context
  createContext,
  // hooks
  withHooks,
  useRef,
  useState,
  useContext,
  useReducer,
  useEffect,
  useLayoutEffect,
  useMemo,
  useCallback,
  useImperativeHandle
} from 'react-polyfill-all';

use react patch

import 'react-polyfill-patch';
import {
  // memo
  memo,
  // ref
  createRef,
  forwardRef,
  // Fragment
  Fragment,
  // PureComponent
  PureComponent,
  // context
  createContext,
  // hooks
  useRef,
  useState,
  useContext,
  useReducer,
  useEffect,
  useLayoutEffect,
  useMemo,
  useCallback,
  useImperativeHandle
} from 'react';
import { createPortal } from 'react-dom';

Rax

version <= 0.6.7

import {
  // memo
  memo,
  // ref
  createRef,
  forwardRef,
  // context
  createContext,
  // hooks
  withHooks,
  useRef,
  useState,
  useContext,
  useReducer,
  useEffect,
  useLayoutEffect,
  useMemo,
  useCallback,
  useImperativeHandle
} from 'rax-polyfill-all';

More information