Pinned Loading
-
useIsMounted.js
useIsMounted.js 1import { useRef } from 'react';
23function useIsMounted() {
4const isMounted = useRef(false);
5 -
useSafeState.js
useSafeState.js 1function useSafeState(initValue) {
2const [state, setState] = useState(initValue);
3const isMounted = useIsMounted();
45// useCallback because we need to add updateState function to effect deps
-
triggerNativeEventFor.ts
triggerNativeEventFor.ts 1type EventData = {
2event: string;
3} & Record<string, unknown>;
45const triggerNativeEventFor = (elm: Element, { event, ...valueObj }: EventData) => {
-
useIsFirstRender.ts
useIsFirstRender.ts 1import { useEffect, useRef } from 'react';
23export function useIsFirstRender(): boolean {
4const isFirstRender = useRef(true);
5 -
useTimeout.ts
useTimeout.ts 1import { useEffect, useRef } from 'react';
23export function useTimeout(callback: () => void, delay: number) {
4const callbackRef = useRef(callback);
5// update current callback every render
-
generateClasses.ts
generateClasses.ts 1const generateClasses = (defaultClass: string) =>
2(childClass = '', props: Record<string, boolean> = {}, additionalClassName = '') => {
3const baseClass = childClass ? `${defaultClass}__${childClass}` : defaultClass;
4const classes = [baseClass];
5
Something went wrong, please refresh the page to try again.
If the problem persists, check the GitHub status page or contact support.
If the problem persists, check the GitHub status page or contact support.