pre-installations and preparations
This commit is contained in:
1 parent
3e5a0329cb
commit
201d621ac3
6977 files changed
+742826
No files matched your search
+1
@@ -0,0 +1 @@
|
||||
export { default } from './useEnhancedEffect';
|
||||
+1
@@ -0,0 +1 @@
|
||||
export { default } from './useEnhancedEffect';
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"sideEffects": false,
|
||||
"module": "./index.js",
|
||||
"main": "../node/useEnhancedEffect/index.js",
|
||||
"types": "./index.d.ts"
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
import * as React from 'react';
|
||||
/**
|
||||
* A version of `React.useLayoutEffect` that does not show a warning when server-side rendering.
|
||||
* This is useful for effects that are only needed for client-side rendering but not for SSR.
|
||||
*
|
||||
* Before you use this hook, make sure to read https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85
|
||||
* and confirm it doesn't apply to your use-case.
|
||||
*/
|
||||
declare const useEnhancedEffect: typeof React.useLayoutEffect;
|
||||
export default useEnhancedEffect;
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
|
||||
/**
|
||||
* A version of `React.useLayoutEffect` that does not show a warning when server-side rendering.
|
||||
* This is useful for effects that are only needed for client-side rendering but not for SSR.
|
||||
*
|
||||
* Before you use this hook, make sure to read https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85
|
||||
* and confirm it doesn't apply to your use-case.
|
||||
*/
|
||||
const useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
|
||||
export default useEnhancedEffect;
|
||||
Reference in new issue
Block a user