init
This commit is contained in:
1
mc_test/node_modules/@emotion/use-insertion-effect-with-fallbacks/src/conditions/false.ts
generated
vendored
Executable file
1
mc_test/node_modules/@emotion/use-insertion-effect-with-fallbacks/src/conditions/false.ts
generated
vendored
Executable file
@ -0,0 +1 @@
|
||||
export default false
|
||||
1
mc_test/node_modules/@emotion/use-insertion-effect-with-fallbacks/src/conditions/is-browser.ts
generated
vendored
Executable file
1
mc_test/node_modules/@emotion/use-insertion-effect-with-fallbacks/src/conditions/is-browser.ts
generated
vendored
Executable file
@ -0,0 +1 @@
|
||||
export default typeof document !== 'undefined'
|
||||
1
mc_test/node_modules/@emotion/use-insertion-effect-with-fallbacks/src/conditions/true.ts
generated
vendored
Executable file
1
mc_test/node_modules/@emotion/use-insertion-effect-with-fallbacks/src/conditions/true.ts
generated
vendored
Executable file
@ -0,0 +1 @@
|
||||
export default true
|
||||
21
mc_test/node_modules/@emotion/use-insertion-effect-with-fallbacks/src/index.ts
generated
vendored
Executable file
21
mc_test/node_modules/@emotion/use-insertion-effect-with-fallbacks/src/index.ts
generated
vendored
Executable file
@ -0,0 +1,21 @@
|
||||
import * as React from 'react'
|
||||
import isBrowser from '#is-browser'
|
||||
|
||||
const syncFallback = <T>(create: () => T) => create()
|
||||
|
||||
const useInsertionEffect = React[
|
||||
('useInsertion' + 'Effect') as 'useInsertionEffect'
|
||||
]
|
||||
? (React[('useInsertion' + 'Effect') as 'useInsertionEffect'] as <T>(
|
||||
create: () => T
|
||||
) => T | undefined)
|
||||
: false
|
||||
|
||||
export const useInsertionEffectAlwaysWithSyncFallback: <T>(
|
||||
create: () => T
|
||||
) => T | undefined = !isBrowser
|
||||
? syncFallback
|
||||
: useInsertionEffect || syncFallback
|
||||
|
||||
export const useInsertionEffectWithLayoutFallback: typeof React.useLayoutEffect =
|
||||
useInsertionEffect || React.useLayoutEffect
|
||||
Reference in New Issue
Block a user