From 3020d9e244674325907c89e84728bb9404fecbc5 Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Wed, 20 Oct 2021 15:08:41 +0200 Subject: [PATCH] def top --- src/style.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/style.js b/src/style.js index 7b9c3e6e..038d2bde 100644 --- a/src/style.js +++ b/src/style.js @@ -2,6 +2,7 @@ import React from 'react' import { useStyleRegistry } from './stylesheet-registry' import { computeId } from './lib/hash' +const useDOMEffects = React.useInsertionEffect || React.useLayoutEffect export default function JSXStyle(props) { const registry = useStyleRegistry() @@ -15,7 +16,6 @@ export default function JSXStyle(props) { return null } - const useDOMEffects = React.useInsertionEffect || React.useLayoutEffect useDOMEffects(() => { registry.add(props) return () => {