Skip to content

Commit

Permalink
Fix useInsertionEffect import to work with older React versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
molefrog committed Apr 18, 2023
1 parent e0de4c4 commit f9333dc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions react-deps.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import {
import * as React from "react";

// React.useInsertionEffect is not available in React <18
const {
useEffect,
useLayoutEffect,
useRef,
useInsertionEffect as useBuiltinInsertionEffect,
} from "react";
useInsertionEffect: useBuiltinInsertionEffect,
} = React;

export {
useState,
Expand Down

0 comments on commit f9333dc

Please sign in to comment.