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 './useOnMount';
|
||||
+1
@@ -0,0 +1 @@
|
||||
export { default } from './useOnMount';
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"sideEffects": false,
|
||||
"module": "./index.js",
|
||||
"main": "../node/useOnMount/index.js",
|
||||
"types": "./index.d.ts"
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
import * as React from 'react';
|
||||
/**
|
||||
* A React.useEffect equivalent that runs once, when the component is mounted.
|
||||
*/
|
||||
export default function useOnMount(fn: React.EffectCallback): void;
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
const EMPTY = [];
|
||||
|
||||
/**
|
||||
* A React.useEffect equivalent that runs once, when the component is mounted.
|
||||
*/
|
||||
export default function useOnMount(fn) {
|
||||
/* eslint-disable react-hooks/exhaustive-deps */
|
||||
React.useEffect(fn, EMPTY);
|
||||
/* eslint-enable react-hooks/exhaustive-deps */
|
||||
}
|
||||
Reference in new issue
Block a user