Začetni commit projekta rezervacije

This commit is contained in:
Mark Poljanšek committed 2025-04-23 20:19:33 +02:00
commit 328731b32f
56062 files changed
+2485242

No files matched your search

+1
View File
@@ -0,0 +1 @@
export { default } from "./useOnMount.js";
+1
View File
@@ -0,0 +1 @@
export { default } from "./useOnMount.js";
+5
View File
@@ -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;
+14
View File
@@ -0,0 +1,14 @@
'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) {
// TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler -- no need to put `fn` in the dependency array
/* eslint-disable react-hooks/exhaustive-deps */
React.useEffect(fn, EMPTY);
/* eslint-enable react-hooks/exhaustive-deps */
}