Initial commit

This commit is contained in:
2025-03-07 19:22:02 +01:00
commit 4a98255d83
55743 changed files with 5280367 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
import * as React from 'react';
/**
* @internal
* Checks if components was mounted the first time.
* Since concurrent mode will be released in the future this needs to be verified
* Currently (React 17) will always render the initial mount once
* https://codesandbox.io/s/heuristic-brook-s4w0q?file=/src/App.jsx
* https://codesandbox.io/s/holy-grass-8nieu?file=/src/App.jsx
*
* @example
* const isFirstMount = useFirstMount();
*/ export function useFirstMount() {
const isFirst = React.useRef(true);
if (isFirst.current) {
isFirst.current = false;
return true;
}
return isFirst.current;
}