Skip to content

Commit

Permalink
use desired insertion hook name
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Oct 20, 2021
1 parent 3020d9e commit 8899084
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/style.js
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import { useStyleRegistry } from './stylesheet-registry'
import { computeId } from './lib/hash'

const useDOMEffects = React.useInsertionEffect || React.useLayoutEffect
const useInsertionEffect = React.useInsertionEffect || React.useLayoutEffect
export default function JSXStyle(props) {
const registry = useStyleRegistry()

Expand All @@ -16,7 +16,7 @@ export default function JSXStyle(props) {
return null
}

useDOMEffects(() => {
useInsertionEffect(() => {
registry.add(props)
return () => {
registry.remove(props)
Expand Down

0 comments on commit 8899084

Please sign in to comment.