diff --git a/jest.config.ts b/jest.config.ts index b759f9031..0d2f04542 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -3,17 +3,22 @@ import { type Config } from 'jest'; // eslint-disable-next-line @typescript-eslint/naming-convention export const __esModule = true; +const moduleNameMapper: Config['moduleNameMapper'] = { + '^((?:\\.{1,2}|#[^\\/]*)/.*)\\.[tj]sx?$': '$1', +}; + +const transform: Config['transform'] = { + '^.+\\.[tj]sx?$': ['@swc/jest', { module: { type: 'commonjs' } }], +}; + export default { extensionsToTreatAsEsm: ['.ts'], + testEnvironment: 'node', projects: [ { displayName: 'dom', - moduleNameMapper: { - '^((?:\\.{1,2}|#[^\\/]*)/.*)\\.js$': '$1', - }, - transform: { - '^.+\\.[tj]sx?$': '@swc/jest', - }, + moduleNameMapper, + transform, testEnvironment: 'jsdom', testMatch: ['/src/**/__tests__/dom.[jt]s?(x)'], setupFiles: ['./src/__tests__/setup.ts'], @@ -21,12 +26,8 @@ export default { { displayName: 'ssr', - moduleNameMapper: { - '^((?:\\.{1,2}|#[^\\/]*)/.*)\\.js$': '$1', - }, - transform: { - '^.+\\.[tj]sx?$': '@swc/jest', - }, + moduleNameMapper, + transform, testEnvironment: 'node', testMatch: ['/src/**/__tests__/ssr.[jt]s?(x)'], }, diff --git a/package.json b/package.json index 469b4fe90..9aa4d811f 100644 --- a/package.json +++ b/package.json @@ -24,9 +24,6 @@ "main": "./src/index.js", "types": "./src/index.d.ts", "sideEffects": false, - "imports": { - "#root/*": "./src/*" - }, "exports": { ".": "./src/index.js", "./*/": "./src/*/index.js", diff --git a/src/useAsync/__docs__/example.stories.tsx b/src/useAsync/__docs__/example.stories.tsx index 1c97cdb9f..6c36f7665 100644 --- a/src/useAsync/__docs__/example.stories.tsx +++ b/src/useAsync/__docs__/example.stories.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { useAsync, useMountEffect } from '#root/index.js'; +import { useAsync, useMountEffect } from '../../index.js'; export function Example() { const [state, actions] = useAsync( diff --git a/src/useAsync/__tests__/dom.ts b/src/useAsync/__tests__/dom.ts index 86973a429..c77f0af33 100644 --- a/src/useAsync/__tests__/dom.ts +++ b/src/useAsync/__tests__/dom.ts @@ -1,5 +1,5 @@ import { act, renderHook } from '@testing-library/react-hooks/dom'; -import { useAsync } from '#root/index.js'; +import { useAsync } from '../../index.js'; function getControllableAsync() { const resolve: { current: undefined | ((result: Res) => void) } = { current: undefined }; diff --git a/src/useAsync/__tests__/ssr.ts b/src/useAsync/__tests__/ssr.ts index 1653eac5d..2b2c50fce 100644 --- a/src/useAsync/__tests__/ssr.ts +++ b/src/useAsync/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useAsync } from '#root/index.js'; +import { useAsync } from '../../index.js'; describe('useAsync', () => { it('should be defined', () => { diff --git a/src/useAsync/index.ts b/src/useAsync/index.ts index 8275ac597..23dcc444c 100644 --- a/src/useAsync/index.ts +++ b/src/useAsync/index.ts @@ -1,5 +1,5 @@ import { useMemo, useRef, useState } from 'react'; -import { useSyncedRef } from '#root/useSyncedRef/index.js'; +import { useSyncedRef } from '../useSyncedRef/index.js'; export type AsyncStatus = 'loading' | 'success' | 'error' | 'not-executed'; diff --git a/src/useAsyncAbortable/__docs__/example.stories.tsx b/src/useAsyncAbortable/__docs__/example.stories.tsx index 8cb5b4cac..bbee44226 100644 --- a/src/useAsyncAbortable/__docs__/example.stories.tsx +++ b/src/useAsyncAbortable/__docs__/example.stories.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { useAsyncAbortable, useMountEffect } from '#root/index.js'; +import { useAsyncAbortable, useMountEffect } from '../../index.js'; export function Example() { const [state, actions, meta] = useAsyncAbortable( diff --git a/src/useAsyncAbortable/__tests__/dom.ts b/src/useAsyncAbortable/__tests__/dom.ts index 09210980c..206eb0bef 100644 --- a/src/useAsyncAbortable/__tests__/dom.ts +++ b/src/useAsyncAbortable/__tests__/dom.ts @@ -1,5 +1,5 @@ import { act, renderHook } from '@testing-library/react-hooks/dom'; -import { useAsyncAbortable } from '#root/index.js'; +import { useAsyncAbortable } from '../../index.js'; function getControllableAsync() { const resolve: { current: undefined | ((result: Res) => void) } = { current: undefined }; diff --git a/src/useAsyncAbortable/__tests__/ssr.ts b/src/useAsyncAbortable/__tests__/ssr.ts index 026279ab7..dad431f83 100644 --- a/src/useAsyncAbortable/__tests__/ssr.ts +++ b/src/useAsyncAbortable/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useAsyncAbortable } from '#root/index.js'; +import { useAsyncAbortable } from '../../index.js'; describe('useAsyncAbortable', () => { it('should be defined', () => { diff --git a/src/useAsyncAbortable/index.ts b/src/useAsyncAbortable/index.ts index 074491dc9..dd2c02c65 100644 --- a/src/useAsyncAbortable/index.ts +++ b/src/useAsyncAbortable/index.ts @@ -4,7 +4,7 @@ import { useAsync, type UseAsyncActions, type UseAsyncMeta, -} from '#root/useAsync/index.js'; +} from '../useAsync/index.js'; export type UseAsyncAbortableActions = { /** diff --git a/src/useClickOutside/__docs__/example.stories.tsx b/src/useClickOutside/__docs__/example.stories.tsx index 258670e47..a72e4c42c 100644 --- a/src/useClickOutside/__docs__/example.stories.tsx +++ b/src/useClickOutside/__docs__/example.stories.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { useRef } from 'react'; -import { useClickOutside, useToggle } from '#root/index.js'; +import { useClickOutside, useToggle } from '../../index.js'; export function Example() { const [toggled, toggle] = useToggle(); diff --git a/src/useClickOutside/__tests__/dom.ts b/src/useClickOutside/__tests__/dom.ts index 7cb833be6..828a7c294 100644 --- a/src/useClickOutside/__tests__/dom.ts +++ b/src/useClickOutside/__tests__/dom.ts @@ -1,6 +1,6 @@ import { renderHook } from '@testing-library/react-hooks/dom'; import { type MutableRefObject } from 'react'; -import { useClickOutside } from '#root/index.js'; +import { useClickOutside } from '../../index.js'; describe('useClickOutside', () => { it('should be defined', () => { diff --git a/src/useClickOutside/__tests__/ssr.ts b/src/useClickOutside/__tests__/ssr.ts index 5173a87d5..62a3a5ab6 100644 --- a/src/useClickOutside/__tests__/ssr.ts +++ b/src/useClickOutside/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useClickOutside } from '#root/index.js'; +import { useClickOutside } from '../../index.js'; describe('useClickOutside', () => { it('should be defined', () => { diff --git a/src/useClickOutside/index.ts b/src/useClickOutside/index.ts index 8aa3935bc..bbc76354a 100644 --- a/src/useClickOutside/index.ts +++ b/src/useClickOutside/index.ts @@ -1,6 +1,6 @@ import { type MutableRefObject, type RefObject, useEffect } from 'react'; -import { useSyncedRef } from '#root/useSyncedRef/index.js'; -import { off, on } from '#root/util/misc.js'; +import { useSyncedRef } from '../useSyncedRef/index.js'; +import { off, on } from '../util/misc.js'; const DEFAULT_EVENTS = ['mousedown', 'touchstart']; diff --git a/src/useConditionalEffect/__docs__/example.stories.tsx b/src/useConditionalEffect/__docs__/example.stories.tsx index be00bf623..59405fb2a 100644 --- a/src/useConditionalEffect/__docs__/example.stories.tsx +++ b/src/useConditionalEffect/__docs__/example.stories.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { useState } from 'react'; -import { useConditionalEffect, useUpdateEffect } from '#root/index.js'; +import { useConditionalEffect, useUpdateEffect } from '../../index.js'; export function Example() { const [state1, setState1] = useState(2); diff --git a/src/useConditionalEffect/__tests__/dom.ts b/src/useConditionalEffect/__tests__/dom.ts index 1438fbe88..38e40c6fe 100644 --- a/src/useConditionalEffect/__tests__/dom.ts +++ b/src/useConditionalEffect/__tests__/dom.ts @@ -5,7 +5,7 @@ import { truthyOrArrayPredicate, useConditionalEffect, useUpdateEffect, -} from '#root/index.js'; +} from '../../index.js'; describe('useConditionalEffect', () => { it('should be defined', () => { diff --git a/src/useConditionalEffect/__tests__/ssr.ts b/src/useConditionalEffect/__tests__/ssr.ts index 52a1e2a73..1af8eceed 100644 --- a/src/useConditionalEffect/__tests__/ssr.ts +++ b/src/useConditionalEffect/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useConditionalEffect } from '#root/index.js'; +import { useConditionalEffect } from '../../index.js'; describe('useConditionalEffect', () => { it('should be defined', () => { diff --git a/src/useConditionalEffect/index.ts b/src/useConditionalEffect/index.ts index 55ca18241..346136057 100644 --- a/src/useConditionalEffect/index.ts +++ b/src/useConditionalEffect/index.ts @@ -1,7 +1,7 @@ import { type DependencyList, useEffect } from 'react'; -import { type ConditionsList, type ConditionsPredicate } from '#root/types.js'; -import { truthyAndArrayPredicate } from '#root/util/const.js'; -import { type EffectCallback, type EffectHook } from '#root/util/misc.js'; +import { type ConditionsList, type ConditionsPredicate } from '../types.js'; +import { truthyAndArrayPredicate } from '../util/const.js'; +import { type EffectCallback, type EffectHook } from '../util/misc.js'; /** * Like `useEffect` but its callback is invoked only if all given conditions match a given predicate. diff --git a/src/useControlledRerenderState/__docs__/example.stories.tsx b/src/useControlledRerenderState/__docs__/example.stories.tsx index a10870456..2ba823114 100644 --- a/src/useControlledRerenderState/__docs__/example.stories.tsx +++ b/src/useControlledRerenderState/__docs__/example.stories.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { useControlledRerenderState, useToggle } from '#root/index.js'; +import { useControlledRerenderState, useToggle } from '../../index.js'; export function Example() { const [state, setState] = useControlledRerenderState(0); diff --git a/src/useControlledRerenderState/__tests__/dom.ts b/src/useControlledRerenderState/__tests__/dom.ts index 00c08f696..42e40a658 100644 --- a/src/useControlledRerenderState/__tests__/dom.ts +++ b/src/useControlledRerenderState/__tests__/dom.ts @@ -1,5 +1,5 @@ import { act, renderHook } from '@testing-library/react-hooks/dom'; -import { useControlledRerenderState } from '#root/index.js'; +import { useControlledRerenderState } from '../../index.js'; describe('useControlledRerenderState', () => { it('should be defined', () => { diff --git a/src/useControlledRerenderState/__tests__/ssr.ts b/src/useControlledRerenderState/__tests__/ssr.ts index 6a66dbe6c..970ca1ebb 100644 --- a/src/useControlledRerenderState/__tests__/ssr.ts +++ b/src/useControlledRerenderState/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useControlledRerenderState } from '#root/index.js'; +import { useControlledRerenderState } from '../../index.js'; describe('useControlledRerenderState', () => { it('should be defined', () => { diff --git a/src/useControlledRerenderState/index.ts b/src/useControlledRerenderState/index.ts index 65a8bfacf..73d2806c0 100644 --- a/src/useControlledRerenderState/index.ts +++ b/src/useControlledRerenderState/index.ts @@ -1,7 +1,7 @@ import { type SetStateAction, useCallback, useRef } from 'react'; -import { useFirstMountState } from '#root/useFirstMountState/index.js'; -import { useRerender } from '#root/useRerender/index.js'; -import { resolveHookState } from '#root/util/resolveHookState.js'; +import { useFirstMountState } from '../useFirstMountState/index.js'; +import { useRerender } from '../useRerender/index.js'; +import { resolveHookState } from '../util/resolveHookState.js'; export type ControlledRerenderDispatch = (value: A, rerender?: boolean) => void; diff --git a/src/useCookieValue/index.ts b/src/useCookieValue/index.ts index c18d29e13..aae012b51 100644 --- a/src/useCookieValue/index.ts +++ b/src/useCookieValue/index.ts @@ -1,9 +1,9 @@ import Cookies from 'js-cookie'; import { type Dispatch, useCallback, useEffect, useState } from 'react'; -import { useFirstMountState } from '#root/useFirstMountState/index.js'; -import { useMountEffect } from '#root/useMountEffect/index.js'; -import { useSyncedRef } from '#root/useSyncedRef/index.js'; -import { isBrowser } from '#root/util/const.js'; +import { useFirstMountState } from '../useFirstMountState/index.js'; +import { useMountEffect } from '../useMountEffect/index.js'; +import { useSyncedRef } from '../useSyncedRef/index.js'; +import { isBrowser } from '../util/const.js'; const cookiesSetters = new Map>>(); diff --git a/src/useCounter/__docs__/example.stories.tsx b/src/useCounter/__docs__/example.stories.tsx index babdf845c..4b22a9a0e 100644 --- a/src/useCounter/__docs__/example.stories.tsx +++ b/src/useCounter/__docs__/example.stories.tsx @@ -1,4 +1,4 @@ -import { useCounter } from '#root/index.js'; +import { useCounter } from '../../index.js'; export function Example() { const [min, { inc: incMin, dec: decMin }] = useCounter(1); diff --git a/src/useCounter/__tests__/dom.ts b/src/useCounter/__tests__/dom.ts index 02c3d7c5b..8649cae51 100644 --- a/src/useCounter/__tests__/dom.ts +++ b/src/useCounter/__tests__/dom.ts @@ -1,5 +1,5 @@ import { act, renderHook } from '@testing-library/react-hooks/dom'; -import { useCounter } from '#root/index.js'; +import { useCounter } from '../../index.js'; describe('useCounter', () => { it('should be defined', () => { diff --git a/src/useCounter/__tests__/ssr.ts b/src/useCounter/__tests__/ssr.ts index 398c8d232..f55e7b8f1 100644 --- a/src/useCounter/__tests__/ssr.ts +++ b/src/useCounter/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useCounter } from '#root/index.js'; +import { useCounter } from '../../index.js'; describe('useCounter', () => { it('should be defined', () => { diff --git a/src/useCounter/index.ts b/src/useCounter/index.ts index 700f2b0d3..ffe264a31 100644 --- a/src/useCounter/index.ts +++ b/src/useCounter/index.ts @@ -1,7 +1,7 @@ import { type SetStateAction, useMemo } from 'react'; -import { useMediatedState } from '#root/useMediatedState/index.js'; -import { useSyncedRef } from '#root/useSyncedRef/index.js'; -import { type InitialState, resolveHookState } from '#root/util/resolveHookState.js'; +import { useMediatedState } from '../useMediatedState/index.js'; +import { useSyncedRef } from '../useSyncedRef/index.js'; +import { type InitialState, resolveHookState } from '../util/resolveHookState.js'; export type CounterActions = { /** diff --git a/src/useCustomCompareEffect/__docs__/example.stories.tsx b/src/useCustomCompareEffect/__docs__/example.stories.tsx index 992bfb33d..518d08081 100644 --- a/src/useCustomCompareEffect/__docs__/example.stories.tsx +++ b/src/useCustomCompareEffect/__docs__/example.stories.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { useCustomCompareEffect, useUpdateEffect } from '#root/index.js'; +import { useCustomCompareEffect, useUpdateEffect } from '../../index.js'; /** * A little hash function to generate a random number used to identify a string. diff --git a/src/useCustomCompareEffect/__tests__/dom.ts b/src/useCustomCompareEffect/__tests__/dom.ts index 2e3cc993c..c9a15b016 100644 --- a/src/useCustomCompareEffect/__tests__/dom.ts +++ b/src/useCustomCompareEffect/__tests__/dom.ts @@ -1,6 +1,6 @@ import { renderHook } from '@testing-library/react-hooks/dom'; import { type DependencyList } from 'react'; -import { type EffectCallback, useCustomCompareEffect, useUpdateEffect } from '#root/index.js'; +import { type EffectCallback, useCustomCompareEffect, useUpdateEffect } from '../../index.js'; describe('useCustomCompareEffect', () => { it('should be defined', () => { diff --git a/src/useCustomCompareEffect/__tests__/ssr.ts b/src/useCustomCompareEffect/__tests__/ssr.ts index 84f385cb8..09d383251 100644 --- a/src/useCustomCompareEffect/__tests__/ssr.ts +++ b/src/useCustomCompareEffect/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useCustomCompareEffect } from '#root/index.js'; +import { useCustomCompareEffect } from '../../index.js'; describe('useCustomCompareEffect', () => { it('should be defined', () => { diff --git a/src/useCustomCompareEffect/index.ts b/src/useCustomCompareEffect/index.ts index 62161af37..32fe8edc2 100644 --- a/src/useCustomCompareEffect/index.ts +++ b/src/useCustomCompareEffect/index.ts @@ -1,7 +1,7 @@ import { type DependencyList, useEffect, useRef } from 'react'; -import { type DependenciesComparator } from '#root/types.js'; -import { isBrowser } from '#root/util/const.js'; -import { basicDepsComparator, type EffectCallback, type EffectHook } from '#root/util/misc.js'; +import { type DependenciesComparator } from '../types.js'; +import { isBrowser } from '../util/const.js'; +import { basicDepsComparator, type EffectCallback, type EffectHook } from '../util/misc.js'; /** * Like `useEffect` but uses provided comparator function to validate dependency changes. diff --git a/src/useCustomCompareMemo/__docs__/example.stories.tsx b/src/useCustomCompareMemo/__docs__/example.stories.tsx index d4d875504..d5b8ce3cd 100644 --- a/src/useCustomCompareMemo/__docs__/example.stories.tsx +++ b/src/useCustomCompareMemo/__docs__/example.stories.tsx @@ -1,5 +1,5 @@ import { useReducer, useMemo, useRef } from 'react'; -import { useCustomCompareMemo } from '#root/index.js'; +import { useCustomCompareMemo } from '../../index.js'; // Data const keys = ['firstname', 'name']; diff --git a/src/useCustomCompareMemo/__tests__/dom.ts b/src/useCustomCompareMemo/__tests__/dom.ts index ef9a32633..e8e07b3a5 100644 --- a/src/useCustomCompareMemo/__tests__/dom.ts +++ b/src/useCustomCompareMemo/__tests__/dom.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks'; -import { useCustomCompareMemo } from '#root/index.js'; +import { useCustomCompareMemo } from '../../index.js'; const mockUser = { name: 'John' }; diff --git a/src/useCustomCompareMemo/__tests__/ssr.ts b/src/useCustomCompareMemo/__tests__/ssr.ts index 0f07eb988..f31180ed1 100644 --- a/src/useCustomCompareMemo/__tests__/ssr.ts +++ b/src/useCustomCompareMemo/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useCustomCompareMemo } from '#root/index.js'; +import { useCustomCompareMemo } from '../../index.js'; describe('useCustomCompareMemo', () => { it('should be defined', () => { diff --git a/src/useCustomCompareMemo/index.ts b/src/useCustomCompareMemo/index.ts index 7f2a640e4..6f6152ec7 100644 --- a/src/useCustomCompareMemo/index.ts +++ b/src/useCustomCompareMemo/index.ts @@ -1,5 +1,5 @@ import { useMemo, useRef, type DependencyList } from 'react'; -import { type DependenciesComparator } from '#root/types.js'; +import { type DependenciesComparator } from '../types.js'; /** * Like useMemo but uses provided comparator function to validate dependency changes. diff --git a/src/useDebouncedCallback/__docs__/example.stories.tsx b/src/useDebouncedCallback/__docs__/example.stories.tsx index 7e91452cb..af2b8713e 100644 --- a/src/useDebouncedCallback/__docs__/example.stories.tsx +++ b/src/useDebouncedCallback/__docs__/example.stories.tsx @@ -1,5 +1,5 @@ import { type ComponentProps, useState } from 'react'; -import { useDebouncedCallback } from '#root/index.js'; +import { useDebouncedCallback } from '../../index.js'; export function Example() { const [state, setState] = useState(''); diff --git a/src/useDebouncedCallback/__tests__/dom.ts b/src/useDebouncedCallback/__tests__/dom.ts index d2a66fdf9..b4f9b303b 100644 --- a/src/useDebouncedCallback/__tests__/dom.ts +++ b/src/useDebouncedCallback/__tests__/dom.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/dom'; -import { useDebouncedCallback } from '#root/index.js'; +import { useDebouncedCallback } from '../../index.js'; function testFn(_a: any, _b: any, _c: any) {} diff --git a/src/useDebouncedCallback/__tests__/ssr.ts b/src/useDebouncedCallback/__tests__/ssr.ts index d42b75926..75b2e23aa 100644 --- a/src/useDebouncedCallback/__tests__/ssr.ts +++ b/src/useDebouncedCallback/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useDebouncedCallback } from '#root/index.js'; +import { useDebouncedCallback } from '../../index.js'; describe('useDebouncedCallback', () => { beforeAll(() => { diff --git a/src/useDebouncedCallback/index.ts b/src/useDebouncedCallback/index.ts index 7f033268e..2b637a529 100644 --- a/src/useDebouncedCallback/index.ts +++ b/src/useDebouncedCallback/index.ts @@ -1,5 +1,5 @@ import { type DependencyList, useMemo, useRef } from 'react'; -import { useUnmountEffect } from '#root/useUnmountEffect/index.js'; +import { useUnmountEffect } from '../useUnmountEffect/index.js'; export type DebouncedFunction any> = ( this: ThisParameterType, diff --git a/src/useDebouncedEffect/__docs__/example.stories.tsx b/src/useDebouncedEffect/__docs__/example.stories.tsx index 759a1c0db..24a934a68 100644 --- a/src/useDebouncedEffect/__docs__/example.stories.tsx +++ b/src/useDebouncedEffect/__docs__/example.stories.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { useState } from 'react'; -import { useDebouncedEffect } from '#root/index.js'; +import { useDebouncedEffect } from '../../index.js'; const HAS_DIGIT_REGEX = /\d/g; diff --git a/src/useDebouncedEffect/__tests__/dom.ts b/src/useDebouncedEffect/__tests__/dom.ts index c75bde8de..d6ad28e06 100644 --- a/src/useDebouncedEffect/__tests__/dom.ts +++ b/src/useDebouncedEffect/__tests__/dom.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/dom'; -import { useDebouncedEffect } from '#root/index.js'; +import { useDebouncedEffect } from '../../index.js'; describe('useDebouncedEffect', () => { beforeAll(() => { diff --git a/src/useDebouncedEffect/__tests__/ssr.ts b/src/useDebouncedEffect/__tests__/ssr.ts index 7b42f78f3..3b7e8372e 100644 --- a/src/useDebouncedEffect/__tests__/ssr.ts +++ b/src/useDebouncedEffect/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useDebouncedEffect } from '#root/index.js'; +import { useDebouncedEffect } from '../../index.js'; describe('useDebouncedEffect', () => { beforeAll(() => { diff --git a/src/useDebouncedEffect/index.ts b/src/useDebouncedEffect/index.ts index f908c4dc7..63cd35670 100644 --- a/src/useDebouncedEffect/index.ts +++ b/src/useDebouncedEffect/index.ts @@ -1,5 +1,5 @@ import { type DependencyList, useEffect } from 'react'; -import { useDebouncedCallback } from '#root/useDebouncedCallback/index.js'; +import { useDebouncedCallback } from '../useDebouncedCallback/index.js'; /** * Like `useEffect`, but the passed function is debounced. diff --git a/src/useDebouncedState/__docs__/example.stories.tsx b/src/useDebouncedState/__docs__/example.stories.tsx index b11f0539e..a89570fb1 100644 --- a/src/useDebouncedState/__docs__/example.stories.tsx +++ b/src/useDebouncedState/__docs__/example.stories.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { useDebouncedState } from '#root/index.js'; +import { useDebouncedState } from '../../index.js'; export function Example() { const [state, setState] = useDebouncedState('', 300, 500); diff --git a/src/useDebouncedState/__tests__/dom.ts b/src/useDebouncedState/__tests__/dom.ts index 850714f10..1ec2d1817 100644 --- a/src/useDebouncedState/__tests__/dom.ts +++ b/src/useDebouncedState/__tests__/dom.ts @@ -1,5 +1,5 @@ import { act, renderHook } from '@testing-library/react-hooks/dom'; -import { useDebouncedState } from '#root/index.js'; +import { useDebouncedState } from '../../index.js'; describe('useDebouncedState', () => { beforeAll(() => { diff --git a/src/useDebouncedState/__tests__/ssr.ts b/src/useDebouncedState/__tests__/ssr.ts index 748d2a623..7b9b47490 100644 --- a/src/useDebouncedState/__tests__/ssr.ts +++ b/src/useDebouncedState/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useDebouncedState } from '#root/index.js'; +import { useDebouncedState } from '../../index.js'; describe('useDebouncedState', () => { beforeAll(() => { diff --git a/src/useDebouncedState/index.ts b/src/useDebouncedState/index.ts index fcc1d0859..fbc8fc0a9 100644 --- a/src/useDebouncedState/index.ts +++ b/src/useDebouncedState/index.ts @@ -1,5 +1,5 @@ import { type Dispatch, type SetStateAction, useState } from 'react'; -import { useDebouncedCallback } from '#root/useDebouncedCallback/index.js'; +import { useDebouncedCallback } from '../useDebouncedCallback/index.js'; /** * Like `useState` but its state setter is debounced. diff --git a/src/useDeepCompareEffect/__docs__/example.stories.tsx b/src/useDeepCompareEffect/__docs__/example.stories.tsx index 75eb36840..b3d657ad0 100644 --- a/src/useDeepCompareEffect/__docs__/example.stories.tsx +++ b/src/useDeepCompareEffect/__docs__/example.stories.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { useEffect } from 'react'; -import { useDeepCompareEffect, useRerender } from '#root/index.js'; +import { useDeepCompareEffect, useRerender } from '../../index.js'; export function Example() { const rerender = useRerender(); diff --git a/src/useDeepCompareEffect/__tests__/dom.ts b/src/useDeepCompareEffect/__tests__/dom.ts index 7e7602699..faff4811d 100644 --- a/src/useDeepCompareEffect/__tests__/dom.ts +++ b/src/useDeepCompareEffect/__tests__/dom.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/dom'; -import { useDeepCompareEffect } from '#root/index.js'; +import { useDeepCompareEffect } from '../../index.js'; describe('useDeepCompareEffect', () => { it('should be defined', () => { diff --git a/src/useDeepCompareEffect/__tests__/ssr.ts b/src/useDeepCompareEffect/__tests__/ssr.ts index 6248e61e3..8372431a9 100644 --- a/src/useDeepCompareEffect/__tests__/ssr.ts +++ b/src/useDeepCompareEffect/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useDeepCompareEffect } from '#root/index.js'; +import { useDeepCompareEffect } from '../../index.js'; describe('useDeepCompareEffect', () => { it('should be defined', () => { diff --git a/src/useDeepCompareEffect/index.ts b/src/useDeepCompareEffect/index.ts index 1dd842ec0..0275e66d8 100644 --- a/src/useDeepCompareEffect/index.ts +++ b/src/useDeepCompareEffect/index.ts @@ -1,7 +1,7 @@ import { isEqual } from '@react-hookz/deep-equal'; import { type DependencyList, useEffect } from 'react'; -import { useCustomCompareEffect } from '#root/useCustomCompareEffect/index.js'; -import { type EffectCallback, type EffectHook } from '#root/util/misc.js'; +import { useCustomCompareEffect } from '../useCustomCompareEffect/index.js'; +import { type EffectCallback, type EffectHook } from '../util/misc.js'; /** * Like `useEffect`, but uses `@react-hookz/deep-equal` comparator function to validate deep diff --git a/src/useDeepCompareMemo/__docs__/example.stories.tsx b/src/useDeepCompareMemo/__docs__/example.stories.tsx index cfc47e956..b54bf8f5f 100644 --- a/src/useDeepCompareMemo/__docs__/example.stories.tsx +++ b/src/useDeepCompareMemo/__docs__/example.stories.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { useMemo } from 'react'; -import { useRerender, useDeepCompareMemo } from '#root/index.js'; +import { useRerender, useDeepCompareMemo } from '../../index.js'; export function Example() { const newOnEveryRender = { value: 'Foo' }; diff --git a/src/useDeepCompareMemo/__tests__/dom.ts b/src/useDeepCompareMemo/__tests__/dom.ts index c67d7ac86..d63a2cadc 100644 --- a/src/useDeepCompareMemo/__tests__/dom.ts +++ b/src/useDeepCompareMemo/__tests__/dom.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/dom'; -import { useDeepCompareMemo } from '#root/index.js'; +import { useDeepCompareMemo } from '../../index.js'; describe('useDeepCompareMemo', () => { it('should be defined', () => { diff --git a/src/useDeepCompareMemo/__tests__/ssr.ts b/src/useDeepCompareMemo/__tests__/ssr.ts index b984d7fbb..7f59df235 100644 --- a/src/useDeepCompareMemo/__tests__/ssr.ts +++ b/src/useDeepCompareMemo/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useDeepCompareMemo } from '#root/index.js'; +import { useDeepCompareMemo } from '../../index.js'; describe('useDeepCompareMemo', () => { it('should be defined', () => { diff --git a/src/useDeepCompareMemo/index.ts b/src/useDeepCompareMemo/index.ts index 2c7e4401b..1175707bb 100644 --- a/src/useDeepCompareMemo/index.ts +++ b/src/useDeepCompareMemo/index.ts @@ -1,6 +1,6 @@ import { isEqual } from '@react-hookz/deep-equal'; import { type DependencyList } from 'react'; -import { useCustomCompareMemo } from '#root/useCustomCompareMemo/index.js'; +import { useCustomCompareMemo } from '../useCustomCompareMemo/index.js'; /** * Like useMemo but validates dependency changes using deep equality check instead of reference check. diff --git a/src/useDocumentVisibility/__docs__/example.stories.tsx b/src/useDocumentVisibility/__docs__/example.stories.tsx index 1ffe2a784..fb7e6ffd4 100644 --- a/src/useDocumentVisibility/__docs__/example.stories.tsx +++ b/src/useDocumentVisibility/__docs__/example.stories.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { useEffect } from 'react'; -import { useDocumentVisibility } from '#root/index.js'; +import { useDocumentVisibility } from '../../index.js'; export function Example() { const isVisible = useDocumentVisibility(); diff --git a/src/useDocumentVisibility/__tests__/dom.ts b/src/useDocumentVisibility/__tests__/dom.ts index 2d34b9434..40370cf35 100644 --- a/src/useDocumentVisibility/__tests__/dom.ts +++ b/src/useDocumentVisibility/__tests__/dom.ts @@ -1,5 +1,5 @@ import { act, renderHook } from '@testing-library/react-hooks/dom'; -import { useDocumentVisibility } from '#root/index.js'; +import { useDocumentVisibility } from '../../index.js'; describe('useDocumentVisibility', () => { it('should be defined', () => { diff --git a/src/useDocumentVisibility/__tests__/ssr.ts b/src/useDocumentVisibility/__tests__/ssr.ts index dbb78ada7..fe1a417b0 100644 --- a/src/useDocumentVisibility/__tests__/ssr.ts +++ b/src/useDocumentVisibility/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useDocumentVisibility } from '#root/index.js'; +import { useDocumentVisibility } from '../../index.js'; describe('useDocumentVisibility', () => { it('should be defined', () => { diff --git a/src/useDocumentVisibility/index.ts b/src/useDocumentVisibility/index.ts index 3c7eb45f7..15a6f8eb2 100644 --- a/src/useDocumentVisibility/index.ts +++ b/src/useDocumentVisibility/index.ts @@ -1,7 +1,7 @@ import { useState } from 'react'; -import { useEventListener } from '#root/useEventListener/index.js'; -import { useMountEffect } from '#root/useMountEffect/index.js'; -import { isBrowser } from '#root/util/const.js'; +import { useEventListener } from '../useEventListener/index.js'; +import { useMountEffect } from '../useMountEffect/index.js'; +import { isBrowser } from '../util/const.js'; const isDocumentVisible = () => document.visibilityState === 'visible'; diff --git a/src/useEventListener/__docs__/example.stories.tsx b/src/useEventListener/__docs__/example.stories.tsx index 950f974cb..efcfde71f 100644 --- a/src/useEventListener/__docs__/example.stories.tsx +++ b/src/useEventListener/__docs__/example.stories.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { useState } from 'react'; -import { useEventListener, useToggle } from '#root/index.js'; +import { useEventListener, useToggle } from '../../index.js'; export function Example() { const [state, setState] = useState(); diff --git a/src/useEventListener/__tests__/dom.ts b/src/useEventListener/__tests__/dom.ts index e60b5d684..e246da68c 100644 --- a/src/useEventListener/__tests__/dom.ts +++ b/src/useEventListener/__tests__/dom.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/dom'; -import { useEventListener } from '#root/index.js'; +import { useEventListener } from '../../index.js'; describe('useEventListener', () => { it('should be defined', () => { diff --git a/src/useEventListener/__tests__/ssr.ts b/src/useEventListener/__tests__/ssr.ts index 479fb69b1..d3b5f65e6 100644 --- a/src/useEventListener/__tests__/ssr.ts +++ b/src/useEventListener/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useEventListener } from '#root/index.js'; +import { useEventListener } from '../../index.js'; describe('useEventListener', () => { it('should be defined', () => { diff --git a/src/useEventListener/index.ts b/src/useEventListener/index.ts index 38fccd107..a3d08921e 100644 --- a/src/useEventListener/index.ts +++ b/src/useEventListener/index.ts @@ -1,7 +1,7 @@ import { type RefObject, useEffect, useMemo } from 'react'; -import { useIsMounted } from '#root/useIsMounted/index.js'; -import { useSyncedRef } from '#root/useSyncedRef/index.js'; -import { hasOwnProperty, off, on } from '#root/util/misc.js'; +import { useIsMounted } from '../useIsMounted/index.js'; +import { useSyncedRef } from '../useSyncedRef/index.js'; +import { hasOwnProperty, off, on } from '../util/misc.js'; /** * An HTML element or ref object containing an HTML element. diff --git a/src/useFirstMountState/__docs__/example.stories.tsx b/src/useFirstMountState/__docs__/example.stories.tsx index d1797178b..bb00f3d05 100644 --- a/src/useFirstMountState/__docs__/example.stories.tsx +++ b/src/useFirstMountState/__docs__/example.stories.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { useFirstMountState, useRerender } from '#root/index.js'; +import { useFirstMountState, useRerender } from '../../index.js'; export function Example() { const isFirstMount = useFirstMountState(); diff --git a/src/useFirstMountState/__tests__/dom.ts b/src/useFirstMountState/__tests__/dom.ts index 13ed3a290..775f8f0d9 100644 --- a/src/useFirstMountState/__tests__/dom.ts +++ b/src/useFirstMountState/__tests__/dom.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/dom'; -import { useFirstMountState } from '#root/index.js'; +import { useFirstMountState } from '../../index.js'; describe('useFirstMountState', () => { it('should return true on first render', () => { diff --git a/src/useFirstMountState/__tests__/ssr.ts b/src/useFirstMountState/__tests__/ssr.ts index c344826a3..62077b8a9 100644 --- a/src/useFirstMountState/__tests__/ssr.ts +++ b/src/useFirstMountState/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useFirstMountState } from '#root/index.js'; +import { useFirstMountState } from '../../index.js'; describe('useFirstMountState', () => { it('should return true on first render', () => { diff --git a/src/useFunctionalState/__tests__/dom.ts b/src/useFunctionalState/__tests__/dom.ts index cc86aa517..1aa159d04 100644 --- a/src/useFunctionalState/__tests__/dom.ts +++ b/src/useFunctionalState/__tests__/dom.ts @@ -1,5 +1,5 @@ import { act, renderHook } from '@testing-library/react-hooks/dom'; -import { useFunctionalState } from '#root/index.js'; +import { useFunctionalState } from '../../index.js'; describe('useFunctionalState', () => { it('should be defined', () => { diff --git a/src/useFunctionalState/__tests__/ssr.ts b/src/useFunctionalState/__tests__/ssr.ts index 917dd38f7..656db4c6b 100644 --- a/src/useFunctionalState/__tests__/ssr.ts +++ b/src/useFunctionalState/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useFunctionalState } from '#root/index.js'; +import { useFunctionalState } from '../../index.js'; describe('useFunctionalState', () => { it('should be defined', () => { diff --git a/src/useFunctionalState/index.ts b/src/useFunctionalState/index.ts index c85ee3605..96e82819f 100644 --- a/src/useFunctionalState/index.ts +++ b/src/useFunctionalState/index.ts @@ -1,5 +1,5 @@ import { type Dispatch, type SetStateAction, useCallback, useState } from 'react'; -import { useSyncedRef } from '#root/useSyncedRef/index.js'; +import { useSyncedRef } from '../useSyncedRef/index.js'; export function useFunctionalState( initialState: S | (() => S) diff --git a/src/useHookableRef/__docs__/example.stories.tsx b/src/useHookableRef/__docs__/example.stories.tsx index 29ae4991d..d1afc8453 100644 --- a/src/useHookableRef/__docs__/example.stories.tsx +++ b/src/useHookableRef/__docs__/example.stories.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { useState } from 'react'; -import { useHookableRef } from '#root/index.js'; +import { useHookableRef } from '../../index.js'; export function Example() { const [get, setGet] = useState(); diff --git a/src/useHookableRef/__tests__/dom.ts b/src/useHookableRef/__tests__/dom.ts index 973ce62b7..a55cd6b5b 100644 --- a/src/useHookableRef/__tests__/dom.ts +++ b/src/useHookableRef/__tests__/dom.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/dom'; -import { useHookableRef } from '#root/index.js'; +import { useHookableRef } from '../../index.js'; describe('useHookableRef', () => { it('should be defined', () => { diff --git a/src/useHookableRef/__tests__/ssr.ts b/src/useHookableRef/__tests__/ssr.ts index 181337e77..fb538d156 100644 --- a/src/useHookableRef/__tests__/ssr.ts +++ b/src/useHookableRef/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useHookableRef } from '#root/index.js'; +import { useHookableRef } from '../../index.js'; describe('useHookableRef', () => { it('should be defined', () => { diff --git a/src/useHookableRef/index.ts b/src/useHookableRef/index.ts index b3ea6700b..feb950cc6 100644 --- a/src/useHookableRef/index.ts +++ b/src/useHookableRef/index.ts @@ -1,5 +1,5 @@ import { type MutableRefObject, useMemo } from 'react'; -import { useSyncedRef } from '#root/useSyncedRef/index.js'; +import { useSyncedRef } from '../useSyncedRef/index.js'; export type HookableRefHandler = (v: T) => T; diff --git a/src/useIntersectionObserver/__docs__/example.stories.tsx b/src/useIntersectionObserver/__docs__/example.stories.tsx index 4516cc106..3f37d4a1c 100644 --- a/src/useIntersectionObserver/__docs__/example.stories.tsx +++ b/src/useIntersectionObserver/__docs__/example.stories.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { useRef } from 'react'; -import { useIntersectionObserver } from '#root/index.js'; +import { useIntersectionObserver } from '../../index.js'; export function Example() { const rootRef = useRef(null); diff --git a/src/useIntersectionObserver/__tests__/dom.ts b/src/useIntersectionObserver/__tests__/dom.ts index 0a064cb77..1205d7b39 100644 --- a/src/useIntersectionObserver/__tests__/dom.ts +++ b/src/useIntersectionObserver/__tests__/dom.ts @@ -1,5 +1,5 @@ import { act, renderHook } from '@testing-library/react-hooks/dom'; -import { useIntersectionObserver } from '#root/index.js'; +import { useIntersectionObserver } from '../../index.js'; import Mock = jest.Mock; describe('useIntersectionObserver', () => { diff --git a/src/useIntersectionObserver/__tests__/ssr.ts b/src/useIntersectionObserver/__tests__/ssr.ts index 0cd96985d..7839b15a6 100644 --- a/src/useIntersectionObserver/__tests__/ssr.ts +++ b/src/useIntersectionObserver/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useIntersectionObserver } from '#root/index.js'; +import { useIntersectionObserver } from '../../index.js'; describe('useIntersectionObserver', () => { it('should be defined', () => { diff --git a/src/useIntervalEffect/__docs__/example.stories.tsx b/src/useIntervalEffect/__docs__/example.stories.tsx index 4d7239cc2..6e360a3e2 100644 --- a/src/useIntervalEffect/__docs__/example.stories.tsx +++ b/src/useIntervalEffect/__docs__/example.stories.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { useState } from 'react'; -import { useIntervalEffect, useToggle } from '#root/index.js'; +import { useIntervalEffect, useToggle } from '../../index.js'; export function Example() { const [state, setState] = useState(); diff --git a/src/useIntervalEffect/__tests__/dom.ts b/src/useIntervalEffect/__tests__/dom.ts index 4bbf7de83..41af8fc5b 100644 --- a/src/useIntervalEffect/__tests__/dom.ts +++ b/src/useIntervalEffect/__tests__/dom.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/dom'; -import { useIntervalEffect } from '#root/index.js'; +import { useIntervalEffect } from '../../index.js'; import advanceTimersByTime = jest.advanceTimersByTime; describe('useIntervalEffect', () => { diff --git a/src/useIntervalEffect/__tests__/ssr.ts b/src/useIntervalEffect/__tests__/ssr.ts index f9ad09c77..ef5efc13e 100644 --- a/src/useIntervalEffect/__tests__/ssr.ts +++ b/src/useIntervalEffect/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useIntervalEffect } from '#root/index.js'; +import { useIntervalEffect } from '../../index.js'; describe('useIntervalEffect', () => { it('should be defined', () => { diff --git a/src/useIntervalEffect/index.ts b/src/useIntervalEffect/index.ts index a9b80ed02..6a3a6de32 100644 --- a/src/useIntervalEffect/index.ts +++ b/src/useIntervalEffect/index.ts @@ -1,5 +1,5 @@ import { useEffect } from 'react'; -import { useSyncedRef } from '#root/useSyncedRef/index.js'; +import { useSyncedRef } from '../useSyncedRef/index.js'; /** * Like `setInterval` but in the form of a React hook. diff --git a/src/useIsMounted/__docs__/example.stories.tsx b/src/useIsMounted/__docs__/example.stories.tsx index 91e6b0867..70abbd2f5 100644 --- a/src/useIsMounted/__docs__/example.stories.tsx +++ b/src/useIsMounted/__docs__/example.stories.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { useIsMounted, useMountEffect, useToggle } from '#root/index.js'; +import { useIsMounted, useMountEffect, useToggle } from '../../index.js'; export function Example() { const [isToggled, toggle] = useToggle(false); diff --git a/src/useIsMounted/__tests__/dom.ts b/src/useIsMounted/__tests__/dom.ts index 3444916ea..5550dd325 100644 --- a/src/useIsMounted/__tests__/dom.ts +++ b/src/useIsMounted/__tests__/dom.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/dom'; -import { useIsMounted } from '#root/index.js'; +import { useIsMounted } from '../../index.js'; describe('useIsMounted', () => { it('should be defined', () => { diff --git a/src/useIsMounted/__tests__/ssr.ts b/src/useIsMounted/__tests__/ssr.ts index b4746994c..52ed209f7 100644 --- a/src/useIsMounted/__tests__/ssr.ts +++ b/src/useIsMounted/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useIsMounted } from '#root/index.js'; +import { useIsMounted } from '../../index.js'; describe('useIsMounted', () => { it('should be defined', () => { diff --git a/src/useIsomorphicLayoutEffect/__tests__/dom.ts b/src/useIsomorphicLayoutEffect/__tests__/dom.ts index 4183cd888..db334dc31 100644 --- a/src/useIsomorphicLayoutEffect/__tests__/dom.ts +++ b/src/useIsomorphicLayoutEffect/__tests__/dom.ts @@ -1,5 +1,5 @@ import { useLayoutEffect } from 'react'; -import { useIsomorphicLayoutEffect } from '#root/index.js'; +import { useIsomorphicLayoutEffect } from '../../index.js'; describe('useIsomorphicLayoutEffect', () => { it('should be defined', () => { diff --git a/src/useIsomorphicLayoutEffect/__tests__/ssr.ts b/src/useIsomorphicLayoutEffect/__tests__/ssr.ts index 9fb77f4d2..04bf787a8 100644 --- a/src/useIsomorphicLayoutEffect/__tests__/ssr.ts +++ b/src/useIsomorphicLayoutEffect/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { useEffect } from 'react'; -import { useIsomorphicLayoutEffect } from '#root/index.js'; +import { useIsomorphicLayoutEffect } from '../../index.js'; describe('useIsomorphicLayoutEffect', () => { it('should be defined', () => { diff --git a/src/useIsomorphicLayoutEffect/index.ts b/src/useIsomorphicLayoutEffect/index.ts index dc76a3fee..1adc019aa 100644 --- a/src/useIsomorphicLayoutEffect/index.ts +++ b/src/useIsomorphicLayoutEffect/index.ts @@ -1,5 +1,5 @@ import { useEffect, useLayoutEffect } from 'react'; -import { isBrowser } from '#root/util/const.js'; +import { isBrowser } from '../util/const.js'; /** * Alias for `useLayoutEffect` in browser, but for `useEffect` at server side. Helps to avoid diff --git a/src/useKeyboardEvent/__docs__/example.stories.tsx b/src/useKeyboardEvent/__docs__/example.stories.tsx index b583b0886..ef1f0e54c 100644 --- a/src/useKeyboardEvent/__docs__/example.stories.tsx +++ b/src/useKeyboardEvent/__docs__/example.stories.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { useState } from 'react'; -import { useKeyboardEvent } from '#root/index.js'; +import { useKeyboardEvent } from '../../index.js'; export function Example() { const [list, setList] = useState([]); diff --git a/src/useKeyboardEvent/__tests__/dom.ts b/src/useKeyboardEvent/__tests__/dom.ts index b4c3f39b9..b7a60952f 100644 --- a/src/useKeyboardEvent/__tests__/dom.ts +++ b/src/useKeyboardEvent/__tests__/dom.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/dom'; -import { type KeyboardEventFilter, useKeyboardEvent } from '#root/index.js'; +import { type KeyboardEventFilter, useKeyboardEvent } from '../../index.js'; describe('useKeyboardEvent', () => { it('should be defined', () => { diff --git a/src/useKeyboardEvent/__tests__/ssr.ts b/src/useKeyboardEvent/__tests__/ssr.ts index fce8071e8..1b1a3b7c7 100644 --- a/src/useKeyboardEvent/__tests__/ssr.ts +++ b/src/useKeyboardEvent/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useKeyboardEvent } from '#root/index.js'; +import { useKeyboardEvent } from '../../index.js'; describe('useKeyboardEvent', () => { it('should be defined', () => { diff --git a/src/useKeyboardEvent/index.ts b/src/useKeyboardEvent/index.ts index 9e9be7027..906b67f3b 100644 --- a/src/useKeyboardEvent/index.ts +++ b/src/useKeyboardEvent/index.ts @@ -1,8 +1,8 @@ import { type DependencyList, type RefObject, useMemo } from 'react'; -import { useEventListener } from '#root/useEventListener/index.js'; -import { useSyncedRef } from '#root/useSyncedRef/index.js'; -import { isBrowser } from '#root/util/const.js'; -import { yieldFalse, yieldTrue } from '#root/util/misc.js'; +import { useEventListener } from '../useEventListener/index.js'; +import { useSyncedRef } from '../useSyncedRef/index.js'; +import { isBrowser } from '../util/const.js'; +import { yieldFalse, yieldTrue } from '../util/misc.js'; export type KeyboardEventPredicate = (event: KeyboardEvent) => boolean; export type KeyboardEventFilter = null | string | boolean | KeyboardEventPredicate; diff --git a/src/useLifecycleLogger/__docs__/example.stories.tsx b/src/useLifecycleLogger/__docs__/example.stories.tsx index 4a469e053..92eee286b 100644 --- a/src/useLifecycleLogger/__docs__/example.stories.tsx +++ b/src/useLifecycleLogger/__docs__/example.stories.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { useRerender, useLifecycleLogger } from '#root/index.js'; +import { useRerender, useLifecycleLogger } from '../../index.js'; export function Example() { const rerender = useRerender(); diff --git a/src/useLifecycleLogger/__tests__/dom.ts b/src/useLifecycleLogger/__tests__/dom.ts index 9a288cda9..9a1bee434 100644 --- a/src/useLifecycleLogger/__tests__/dom.ts +++ b/src/useLifecycleLogger/__tests__/dom.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/dom'; -import { useLifecycleLogger } from '#root/index.js'; +import { useLifecycleLogger } from '../../index.js'; describe('useLifecycleLogger', () => { let logSpy: jest.SpyInstance; diff --git a/src/useLifecycleLogger/__tests__/ssr.ts b/src/useLifecycleLogger/__tests__/ssr.ts index 178c8d07a..25eaaba5f 100644 --- a/src/useLifecycleLogger/__tests__/ssr.ts +++ b/src/useLifecycleLogger/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useLifecycleLogger } from '#root/index.js'; +import { useLifecycleLogger } from '../../index.js'; describe('useLifecycleLogger', () => { it('should be defined', () => { diff --git a/src/useList/__docs__/example.stories.tsx b/src/useList/__docs__/example.stories.tsx index f8e990a4a..7bf24e7b3 100644 --- a/src/useList/__docs__/example.stories.tsx +++ b/src/useList/__docs__/example.stories.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { useList } from '#root/index.js'; +import { useList } from '../../index.js'; export function Example() { const [ diff --git a/src/useList/__tests__/dom.ts b/src/useList/__tests__/dom.ts index f71dffb1a..fd508a15d 100644 --- a/src/useList/__tests__/dom.ts +++ b/src/useList/__tests__/dom.ts @@ -1,6 +1,6 @@ /* eslint-disable max-nested-callbacks */ import { act, renderHook } from '@testing-library/react-hooks/dom'; -import { useList } from '#root/index.js'; +import { useList } from '../../index.js'; describe('useList', () => { it('should be defined', () => { diff --git a/src/useList/__tests__/ssr.ts b/src/useList/__tests__/ssr.ts index 11346f112..676eddb73 100644 --- a/src/useList/__tests__/ssr.ts +++ b/src/useList/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useList } from '#root/index.js'; +import { useList } from '../../index.js'; describe('useList', () => { it('should be defined', () => { diff --git a/src/useList/index.ts b/src/useList/index.ts index a978b5654..7c8053137 100644 --- a/src/useList/index.ts +++ b/src/useList/index.ts @@ -1,7 +1,7 @@ import { type SetStateAction, useMemo, useRef } from 'react'; -import { useRerender } from '#root/useRerender/index.js'; -import { useSyncedRef } from '#root/useSyncedRef/index.js'; -import { type InitialState, resolveHookState } from '#root/util/resolveHookState.js'; +import { useRerender } from '../useRerender/index.js'; +import { useSyncedRef } from '../useSyncedRef/index.js'; +import { type InitialState, resolveHookState } from '../util/resolveHookState.js'; export type ListActions = { /** diff --git a/src/useLocalStorageValue/__docs__/example.stories.tsx b/src/useLocalStorageValue/__docs__/example.stories.tsx index d7f86bfb1..5111ea825 100644 --- a/src/useLocalStorageValue/__docs__/example.stories.tsx +++ b/src/useLocalStorageValue/__docs__/example.stories.tsx @@ -1,4 +1,4 @@ -import { useLocalStorageValue } from '#root/index.js'; +import { useLocalStorageValue } from '../../index.js'; type ExampleProps = { /** diff --git a/src/useLocalStorageValue/__tests__/dom.ts b/src/useLocalStorageValue/__tests__/dom.ts index c2fa9b345..5a6b6ddb5 100644 --- a/src/useLocalStorageValue/__tests__/dom.ts +++ b/src/useLocalStorageValue/__tests__/dom.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/dom'; -import { useLocalStorageValue } from '#root/index.js'; +import { useLocalStorageValue } from '../../index.js'; describe('useLocalStorageValue', () => { it('should be defined', () => { diff --git a/src/useLocalStorageValue/__tests__/ssr.ts b/src/useLocalStorageValue/__tests__/ssr.ts index 073bb44da..22e64dc27 100644 --- a/src/useLocalStorageValue/__tests__/ssr.ts +++ b/src/useLocalStorageValue/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useLocalStorageValue } from '#root/index.js'; +import { useLocalStorageValue } from '../../index.js'; describe('useLocalStorageValue', () => { it('should be defined', () => { diff --git a/src/useLocalStorageValue/index.ts b/src/useLocalStorageValue/index.ts index 779c5f1ff..8c0557789 100644 --- a/src/useLocalStorageValue/index.ts +++ b/src/useLocalStorageValue/index.ts @@ -2,8 +2,8 @@ import { useStorageValue, type UseStorageValueOptions, type UseStorageValueResult, -} from '#root/useStorageValue/index.js'; -import { isBrowser, noop } from '#root/util/const.js'; +} from '../useStorageValue/index.js'; +import { isBrowser, noop } from '../util/const.js'; let IS_LOCAL_STORAGE_AVAILABLE: boolean; diff --git a/src/useMap/__docs__/example.stories.tsx b/src/useMap/__docs__/example.stories.tsx index 8a62a7b97..b7c7bba31 100644 --- a/src/useMap/__docs__/example.stories.tsx +++ b/src/useMap/__docs__/example.stories.tsx @@ -1,6 +1,6 @@ /* eslint-disable react/no-unescaped-entities */ import * as React from 'react'; -import { useMap } from '#root/index.js'; +import { useMap } from '../../index.js'; export function Example() { const map = useMap([['@react-hooks', 'is awesome']]); diff --git a/src/useMap/__tests__/dom.ts b/src/useMap/__tests__/dom.ts index 8c81f8f71..73795054b 100644 --- a/src/useMap/__tests__/dom.ts +++ b/src/useMap/__tests__/dom.ts @@ -1,5 +1,5 @@ import { renderHook, act } from '@testing-library/react-hooks/dom'; -import { useMap } from '#root/index.js'; +import { useMap } from '../../index.js'; describe('useMap', () => { it('should be defined', () => { diff --git a/src/useMap/__tests__/ssr.ts b/src/useMap/__tests__/ssr.ts index 12868b045..1f6f67144 100644 --- a/src/useMap/__tests__/ssr.ts +++ b/src/useMap/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook, act } from '@testing-library/react-hooks/server'; -import { useMap } from '#root/index.js'; +import { useMap } from '../../index.js'; describe('useMap', () => { it('should be defined', () => { diff --git a/src/useMap/index.ts b/src/useMap/index.ts index f46486100..dbf86f9d6 100644 --- a/src/useMap/index.ts +++ b/src/useMap/index.ts @@ -1,5 +1,5 @@ import { useRef } from 'react'; -import { useRerender } from '#root/useRerender/index.js'; +import { useRerender } from '../useRerender/index.js'; const proto = Map.prototype; diff --git a/src/useMeasure/__docs__/example.stories.tsx b/src/useMeasure/__docs__/example.stories.tsx index 57a0991e8..82345456c 100644 --- a/src/useMeasure/__docs__/example.stories.tsx +++ b/src/useMeasure/__docs__/example.stories.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { useMeasure } from '#root/index.js'; +import { useMeasure } from '../../index.js'; export function Example() { const [measurements, ref] = useMeasure(); diff --git a/src/useMeasure/__tests__/dom.ts b/src/useMeasure/__tests__/dom.ts index ebb1c5f2b..4836ee8d0 100644 --- a/src/useMeasure/__tests__/dom.ts +++ b/src/useMeasure/__tests__/dom.ts @@ -1,6 +1,6 @@ import { act, renderHook } from '@testing-library/react-hooks/dom'; import { useEffect } from 'react'; -import { useMeasure } from '#root/index.js'; +import { useMeasure } from '../../index.js'; import Mock = jest.Mock; describe('useMeasure', () => { diff --git a/src/useMeasure/__tests__/ssr.ts b/src/useMeasure/__tests__/ssr.ts index 320aeb00b..4f9797e53 100644 --- a/src/useMeasure/__tests__/ssr.ts +++ b/src/useMeasure/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useMeasure } from '#root/index.js'; +import { useMeasure } from '../../index.js'; import Mock = jest.Mock; describe('useMeasure', () => { diff --git a/src/useMeasure/index.ts b/src/useMeasure/index.ts index 0f5e4ac1e..9a8e54cd0 100644 --- a/src/useMeasure/index.ts +++ b/src/useMeasure/index.ts @@ -1,10 +1,7 @@ import { type MutableRefObject, useState } from 'react'; -import { useHookableRef } from '#root/useHookableRef/index.js'; -import { useRafCallback } from '#root/useRafCallback/index.js'; -import { - useResizeObserver, - type UseResizeObserverCallback, -} from '#root/useResizeObserver/index.js'; +import { useHookableRef } from '../useHookableRef/index.js'; +import { useRafCallback } from '../useRafCallback/index.js'; +import { useResizeObserver, type UseResizeObserverCallback } from '../useResizeObserver/index.js'; export type Measures = { width: number; diff --git a/src/useMediaQuery/__docs__/example.stories.tsx b/src/useMediaQuery/__docs__/example.stories.tsx index 5ae7727e7..44731c6bc 100644 --- a/src/useMediaQuery/__docs__/example.stories.tsx +++ b/src/useMediaQuery/__docs__/example.stories.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { useMediaQuery } from '#root/index.js'; +import { useMediaQuery } from '../../index.js'; export function Example() { const isSmallDevice = useMediaQuery('only screen and (max-width : 768px)'); diff --git a/src/useMediaQuery/__tests__/dom.ts b/src/useMediaQuery/__tests__/dom.ts index 2953e03f6..8776ab8d5 100644 --- a/src/useMediaQuery/__tests__/dom.ts +++ b/src/useMediaQuery/__tests__/dom.ts @@ -1,5 +1,5 @@ import { act, renderHook } from '@testing-library/react-hooks/dom'; -import { useMediaQuery } from '#root/index.js'; +import { useMediaQuery } from '../../index.js'; describe('useMediaQuery', () => { type MutableMediaQueryList = { diff --git a/src/useMediaQuery/__tests__/ssr.ts b/src/useMediaQuery/__tests__/ssr.ts index 0f14f8716..4651fb073 100644 --- a/src/useMediaQuery/__tests__/ssr.ts +++ b/src/useMediaQuery/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useMediaQuery } from '#root/index.js'; +import { useMediaQuery } from '../../index.js'; describe('useMediaQuery', () => { it('should be defined', () => { diff --git a/src/useMediaQuery/index.ts b/src/useMediaQuery/index.ts index f8bc8ef77..e4d43b380 100644 --- a/src/useMediaQuery/index.ts +++ b/src/useMediaQuery/index.ts @@ -1,5 +1,5 @@ import { type Dispatch, useEffect, useState } from 'react'; -import { isBrowser } from '#root/util/const.js'; +import { isBrowser } from '../util/const.js'; const queriesMap = new Map< string, diff --git a/src/useMediatedState/__docs__/example.stories.tsx b/src/useMediatedState/__docs__/example.stories.tsx index 16654c900..7702f934b 100644 --- a/src/useMediatedState/__docs__/example.stories.tsx +++ b/src/useMediatedState/__docs__/example.stories.tsx @@ -1,4 +1,4 @@ -import { useMediatedState } from '#root/index.js'; +import { useMediatedState } from '../../index.js'; export function Example() { const nonLetterRe = /[^a-z]+/gi; diff --git a/src/useMediatedState/__tests__/dom.ts b/src/useMediatedState/__tests__/dom.ts index 2bcadb8c2..0268c8c48 100644 --- a/src/useMediatedState/__tests__/dom.ts +++ b/src/useMediatedState/__tests__/dom.ts @@ -1,5 +1,5 @@ import { act, renderHook } from '@testing-library/react-hooks/dom'; -import { useMediatedState } from '#root/index.js'; +import { useMediatedState } from '../../index.js'; describe('useMediatedState', () => { it('should be defined', () => { diff --git a/src/useMediatedState/__tests__/ssr.ts b/src/useMediatedState/__tests__/ssr.ts index d9ca33303..b4d13be51 100644 --- a/src/useMediatedState/__tests__/ssr.ts +++ b/src/useMediatedState/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useMediatedState } from '#root/index.js'; +import { useMediatedState } from '../../index.js'; describe('useMediatedState', () => { it('should be defined', () => { diff --git a/src/useMediatedState/index.ts b/src/useMediatedState/index.ts index 72ddd88b2..9bab8b711 100644 --- a/src/useMediatedState/index.ts +++ b/src/useMediatedState/index.ts @@ -1,10 +1,6 @@ import { type Dispatch, useCallback, useState } from 'react'; -import { useSyncedRef } from '#root/useSyncedRef/index.js'; -import { - type InitialState, - type NextState, - resolveHookState, -} from '#root/util/resolveHookState.js'; +import { useSyncedRef } from '../useSyncedRef/index.js'; +import { type InitialState, type NextState, resolveHookState } from '../util/resolveHookState.js'; export function useMediatedState(): [ State | undefined, diff --git a/src/useMountEffect/__docs__/example.stories.tsx b/src/useMountEffect/__docs__/example.stories.tsx index b2f54710f..db750b7bd 100644 --- a/src/useMountEffect/__docs__/example.stories.tsx +++ b/src/useMountEffect/__docs__/example.stories.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { useState } from 'react'; -import { useRerender, useMountEffect } from '#root/index.js'; +import { useRerender, useMountEffect } from '../../index.js'; export function Example() { const [count, setCount] = useState(0); diff --git a/src/useMountEffect/__tests__/dom.ts b/src/useMountEffect/__tests__/dom.ts index 83696e0b2..afad851cd 100644 --- a/src/useMountEffect/__tests__/dom.ts +++ b/src/useMountEffect/__tests__/dom.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/dom'; -import { useMountEffect } from '#root/index.js'; +import { useMountEffect } from '../../index.js'; describe('useMountEffect', () => { it('should call effector only on first render', () => { diff --git a/src/useMountEffect/__tests__/ssr.ts b/src/useMountEffect/__tests__/ssr.ts index 942719838..d69828e66 100644 --- a/src/useMountEffect/__tests__/ssr.ts +++ b/src/useMountEffect/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useMountEffect } from '#root/index.js'; +import { useMountEffect } from '../../index.js'; describe('useMountEffect', () => { it('should call effector only on first render', () => { diff --git a/src/useNetworkState/__docs__/example.stories.tsx b/src/useNetworkState/__docs__/example.stories.tsx index dd47e52f9..c44c80033 100644 --- a/src/useNetworkState/__docs__/example.stories.tsx +++ b/src/useNetworkState/__docs__/example.stories.tsx @@ -1,4 +1,4 @@ -import { useNetworkState } from '#root/index.js'; +import { useNetworkState } from '../../index.js'; export function Example() { const onlineState = useNetworkState(); diff --git a/src/useNetworkState/__tests__/dom.ts b/src/useNetworkState/__tests__/dom.ts index 0411d2f7f..61defcc4b 100644 --- a/src/useNetworkState/__tests__/dom.ts +++ b/src/useNetworkState/__tests__/dom.ts @@ -1,6 +1,6 @@ import { act, renderHook } from '@testing-library/react-hooks/dom'; import { useRef } from 'react'; -import { useNetworkState } from '#root/index.js'; +import { useNetworkState } from '../../index.js'; describe(`useNetworkState`, () => { it('should be defined', () => { diff --git a/src/useNetworkState/__tests__/ssr.ts b/src/useNetworkState/__tests__/ssr.ts index 8385d92d1..fe6e034bc 100644 --- a/src/useNetworkState/__tests__/ssr.ts +++ b/src/useNetworkState/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useNetworkState } from '#root/index.js'; +import { useNetworkState } from '../../index.js'; describe(`useNetworkState`, () => { it('should be defined', () => { diff --git a/src/useNetworkState/index.ts b/src/useNetworkState/index.ts index a9d1b7f09..59ce823a7 100644 --- a/src/useNetworkState/index.ts +++ b/src/useNetworkState/index.ts @@ -1,7 +1,7 @@ import { useEffect, useState } from 'react'; -import { isBrowser } from '#root/util/const.js'; -import { off, on } from '#root/util/misc.js'; -import { type InitialState } from '#root/util/resolveHookState.js'; +import { isBrowser } from '../util/const.js'; +import { off, on } from '../util/misc.js'; +import { type InitialState } from '../util/resolveHookState.js'; export type NetworkInformation = { readonly downlink: number; diff --git a/src/usePermission/__docs__/example.stories.tsx b/src/usePermission/__docs__/example.stories.tsx index 9ab3358db..2ae2edc8d 100644 --- a/src/usePermission/__docs__/example.stories.tsx +++ b/src/usePermission/__docs__/example.stories.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { usePermission } from '#root/index.js'; +import { usePermission } from '../../index.js'; export function Example() { const status = usePermission({ name: 'notifications' }); diff --git a/src/usePermission/__tests__/dom.ts b/src/usePermission/__tests__/dom.ts index 87695742e..313955ed1 100644 --- a/src/usePermission/__tests__/dom.ts +++ b/src/usePermission/__tests__/dom.ts @@ -1,5 +1,5 @@ import { act, renderHook } from '@testing-library/react-hooks/dom'; -import { usePermission } from '#root/index.js'; +import { usePermission } from '../../index.js'; describe('usePermission', () => { let querySpy: jest.SpyInstance; diff --git a/src/usePermission/__tests__/ssr.ts b/src/usePermission/__tests__/ssr.ts index 64ac5e13d..83f6a1fe3 100644 --- a/src/usePermission/__tests__/ssr.ts +++ b/src/usePermission/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { usePermission } from '#root/index.js'; +import { usePermission } from '../../index.js'; describe('usePermission', () => { it('should be defined', () => { diff --git a/src/usePermission/index.ts b/src/usePermission/index.ts index cf087f0de..1736878f3 100644 --- a/src/usePermission/index.ts +++ b/src/usePermission/index.ts @@ -1,5 +1,5 @@ import { type MutableRefObject, useEffect, useState } from 'react'; -import { off, on } from '#root/util/misc.js'; +import { off, on } from '../util/misc.js'; export type UsePermissionState = PermissionState | 'not-requested' | 'requested'; diff --git a/src/usePrevious/__docs__/example.stories.tsx b/src/usePrevious/__docs__/example.stories.tsx index b385a1841..57085f435 100644 --- a/src/usePrevious/__docs__/example.stories.tsx +++ b/src/usePrevious/__docs__/example.stories.tsx @@ -1,5 +1,5 @@ import { useState } from 'react'; -import { usePrevious } from '#root/index.js'; +import { usePrevious } from '../../index.js'; export function Example() { const [value, setValue] = useState(0); diff --git a/src/usePrevious/__tests__/dom.ts b/src/usePrevious/__tests__/dom.ts index 6f798f98a..d5487b9d9 100644 --- a/src/usePrevious/__tests__/dom.ts +++ b/src/usePrevious/__tests__/dom.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/dom'; -import { usePrevious } from '#root/index.js'; +import { usePrevious } from '../../index.js'; describe('usePrevious', () => { it('should be defined', () => { diff --git a/src/usePrevious/__tests__/ssr.ts b/src/usePrevious/__tests__/ssr.ts index c1c934ef9..ca5f3c9ea 100644 --- a/src/usePrevious/__tests__/ssr.ts +++ b/src/usePrevious/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { usePrevious } from '#root/index.js'; +import { usePrevious } from '../../index.js'; describe('usePrevious', () => { it('should be defined', () => { diff --git a/src/usePreviousDistinct/__docs__/example.stories.tsx b/src/usePreviousDistinct/__docs__/example.stories.tsx index c3163e2aa..dad5890d8 100644 --- a/src/usePreviousDistinct/__docs__/example.stories.tsx +++ b/src/usePreviousDistinct/__docs__/example.stories.tsx @@ -1,5 +1,5 @@ import { useState } from 'react'; -import { usePreviousDistinct } from '#root/index.js'; +import { usePreviousDistinct } from '../../index.js'; export function Example() { const [value, setValue] = useState(0); diff --git a/src/usePreviousDistinct/__tests__/dom.ts b/src/usePreviousDistinct/__tests__/dom.ts index df0286dd8..c20e85e01 100644 --- a/src/usePreviousDistinct/__tests__/dom.ts +++ b/src/usePreviousDistinct/__tests__/dom.ts @@ -1,7 +1,7 @@ import { renderHook } from '@testing-library/react-hooks/dom'; -import { usePreviousDistinct } from '#root/index.js'; -import { isStrictEqual } from '#root/util/const.js'; +import { usePreviousDistinct } from '../../index.js'; import { type Predicate } from '../../types.js'; +import { isStrictEqual } from '../../util/const.js'; describe('usePreviousDistinct', () => { it('should be defined', () => { diff --git a/src/usePreviousDistinct/__tests__/ssr.ts b/src/usePreviousDistinct/__tests__/ssr.ts index a7829a6f0..216dd2305 100644 --- a/src/usePreviousDistinct/__tests__/ssr.ts +++ b/src/usePreviousDistinct/__tests__/ssr.ts @@ -1,6 +1,6 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { usePreviousDistinct } from '#root/index.js'; -import { isStrictEqual } from '#root/util/const.js'; +import { usePreviousDistinct } from '../../index.js'; +import { isStrictEqual } from '../../util/const.js'; describe('usePreviousDistinct', () => { it('should be defined', () => { diff --git a/src/usePreviousDistinct/index.ts b/src/usePreviousDistinct/index.ts index bc6f4e2a6..056996bdb 100644 --- a/src/usePreviousDistinct/index.ts +++ b/src/usePreviousDistinct/index.ts @@ -1,7 +1,7 @@ import { useRef, useState } from 'react'; -import { type Predicate } from '#root/types.js'; -import { useUpdateEffect } from '#root/useUpdateEffect/index.js'; -import { isStrictEqual } from '#root/util/const.js'; +import { type Predicate } from '../types.js'; +import { useUpdateEffect } from '../useUpdateEffect/index.js'; +import { isStrictEqual } from '../util/const.js'; /** * Returns the most recent _distinct_ value passed to the hook on previous render. Distinct here diff --git a/src/useQueue/__docs__/example.stories.tsx b/src/useQueue/__docs__/example.stories.tsx index 6ee2fa22e..8e89af82c 100644 --- a/src/useQueue/__docs__/example.stories.tsx +++ b/src/useQueue/__docs__/example.stories.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { useQueue } from '#root/index.js'; +import { useQueue } from '../../index.js'; export function Example() { const { add, remove, first, last, size, items } = useQueue([1, 2, 3]); diff --git a/src/useQueue/__tests__/dom.ts b/src/useQueue/__tests__/dom.ts index bdf907c23..d49a75185 100644 --- a/src/useQueue/__tests__/dom.ts +++ b/src/useQueue/__tests__/dom.ts @@ -1,5 +1,5 @@ import { act, renderHook } from '@testing-library/react-hooks/dom'; -import { useQueue } from '#root/index.js'; +import { useQueue } from '../../index.js'; describe('useQueue', () => { it('should be defined', () => { diff --git a/src/useQueue/__tests__/ssr.ts b/src/useQueue/__tests__/ssr.ts index 1f3a61925..3b9a52943 100644 --- a/src/useQueue/__tests__/ssr.ts +++ b/src/useQueue/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useQueue } from '#root/index.js'; +import { useQueue } from '../../index.js'; describe('useQueue', () => { it('should be defined', () => { diff --git a/src/useQueue/index.ts b/src/useQueue/index.ts index c2e0b1881..3efc597e3 100644 --- a/src/useQueue/index.ts +++ b/src/useQueue/index.ts @@ -1,6 +1,6 @@ import { useMemo } from 'react'; -import { useList } from '#root/useList/index.js'; -import { useSyncedRef } from '#root/useSyncedRef/index.js'; +import { useList } from '../useList/index.js'; +import { useSyncedRef } from '../useSyncedRef/index.js'; export type QueueMethods = { /** diff --git a/src/useRafCallback/__docs__/example.stories.tsx b/src/useRafCallback/__docs__/example.stories.tsx index 3fe5e3c31..29212cbb2 100644 --- a/src/useRafCallback/__docs__/example.stories.tsx +++ b/src/useRafCallback/__docs__/example.stories.tsx @@ -1,5 +1,5 @@ import { useCallback, useState } from 'react'; -import { useRafCallback } from '#root/index.js'; +import { useRafCallback } from '../../index.js'; export function Example() { const [eventDate, setEventDate] = useState(); diff --git a/src/useRafCallback/__tests__/dom.ts b/src/useRafCallback/__tests__/dom.ts index 45b7ab826..84176ce61 100644 --- a/src/useRafCallback/__tests__/dom.ts +++ b/src/useRafCallback/__tests__/dom.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/dom'; -import { useRafCallback } from '#root/index.js'; +import { useRafCallback } from '../../index.js'; function testFn(_a: any, _b: any, _c: any) {} diff --git a/src/useRafCallback/__tests__/ssr.ts b/src/useRafCallback/__tests__/ssr.ts index 20f0aee58..73c56bc69 100644 --- a/src/useRafCallback/__tests__/ssr.ts +++ b/src/useRafCallback/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useRafCallback } from '#root/index.js'; +import { useRafCallback } from '../../index.js'; describe('useRafCallback', () => { it('should be defined', () => { diff --git a/src/useRafCallback/index.ts b/src/useRafCallback/index.ts index 16c0d28f5..f88c7f1cd 100644 --- a/src/useRafCallback/index.ts +++ b/src/useRafCallback/index.ts @@ -1,7 +1,7 @@ import { useCallback, useMemo, useRef } from 'react'; -import { useSyncedRef } from '#root/useSyncedRef/index.js'; -import { useUnmountEffect } from '#root/useUnmountEffect/index.js'; -import { isBrowser } from '#root/util/const.js'; +import { useSyncedRef } from '../useSyncedRef/index.js'; +import { useUnmountEffect } from '../useUnmountEffect/index.js'; +import { isBrowser } from '../util/const.js'; /** * Makes passed function to be called within next animation frame. diff --git a/src/useRafEffect/__docs__/example.stories.tsx b/src/useRafEffect/__docs__/example.stories.tsx index 292859a18..6df8c06ad 100644 --- a/src/useRafEffect/__docs__/example.stories.tsx +++ b/src/useRafEffect/__docs__/example.stories.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { useRef } from 'react'; -import { useRafEffect } from '#root/index.js'; +import { useRafEffect } from '../../index.js'; export function Example() { const inputRef = useRef(null); diff --git a/src/useRafEffect/__tests__/dom.ts b/src/useRafEffect/__tests__/dom.ts index a5393afdd..57275cd60 100644 --- a/src/useRafEffect/__tests__/dom.ts +++ b/src/useRafEffect/__tests__/dom.ts @@ -1,5 +1,5 @@ import { act, renderHook } from '@testing-library/react-hooks/dom'; -import { useRafEffect } from '#root/index.js'; +import { useRafEffect } from '../../index.js'; describe('useRafEffect', () => { const raf = global.requestAnimationFrame; diff --git a/src/useRafEffect/__tests__/ssr.ts b/src/useRafEffect/__tests__/ssr.ts index 7821f33be..a9df39e83 100644 --- a/src/useRafEffect/__tests__/ssr.ts +++ b/src/useRafEffect/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useRafEffect } from '#root/index.js'; +import { useRafEffect } from '../../index.js'; describe('useRafEffect', () => { it('should be defined', () => { diff --git a/src/useRafEffect/index.ts b/src/useRafEffect/index.ts index 7abac6d01..e394a2d31 100644 --- a/src/useRafEffect/index.ts +++ b/src/useRafEffect/index.ts @@ -1,5 +1,5 @@ import { type DependencyList, useEffect } from 'react'; -import { useRafCallback } from '#root/useRafCallback/index.js'; +import { useRafCallback } from '../useRafCallback/index.js'; /** * Like `React.useEffect`, but state is only updated within animation frame. diff --git a/src/useRafState/__docs__/example.stories.tsx b/src/useRafState/__docs__/example.stories.tsx index 5a54d0679..6bf8e39f5 100644 --- a/src/useRafState/__docs__/example.stories.tsx +++ b/src/useRafState/__docs__/example.stories.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { useMountEffect, useRafState } from '#root/index.js'; +import { useMountEffect, useRafState } from '../../index.js'; export function Example() { const [state, setState] = useRafState({ x: 0, y: 0 }); diff --git a/src/useRafState/__tests__/dom.ts b/src/useRafState/__tests__/dom.ts index 54c25d98a..43580e995 100644 --- a/src/useRafState/__tests__/dom.ts +++ b/src/useRafState/__tests__/dom.ts @@ -1,5 +1,5 @@ import { act, renderHook } from '@testing-library/react-hooks/dom'; -import { useRafState } from '#root/index.js'; +import { useRafState } from '../../index.js'; describe('useRafState', () => { const raf = global.requestAnimationFrame; diff --git a/src/useRafState/__tests__/ssr.ts b/src/useRafState/__tests__/ssr.ts index 70b5fb713..d34d53be1 100644 --- a/src/useRafState/__tests__/ssr.ts +++ b/src/useRafState/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useRafState } from '#root/index.js'; +import { useRafState } from '../../index.js'; describe('useRafState', () => { it('should be defined', () => { diff --git a/src/useRafState/index.ts b/src/useRafState/index.ts index d2fb0459a..8a4201abe 100644 --- a/src/useRafState/index.ts +++ b/src/useRafState/index.ts @@ -1,6 +1,6 @@ import { type Dispatch, type SetStateAction, useState } from 'react'; -import { useRafCallback } from '#root/useRafCallback/index.js'; -import { useUnmountEffect } from '#root/useUnmountEffect/index.js'; +import { useRafCallback } from '../useRafCallback/index.js'; +import { useUnmountEffect } from '../useUnmountEffect/index.js'; export function useRafState(initialState: S | (() => S)): [S, Dispatch>]; export function useRafState(): [ diff --git a/src/useRenderCount/__docs__/example.stories.tsx b/src/useRenderCount/__docs__/example.stories.tsx index c101ea43d..bf5f7b12e 100644 --- a/src/useRenderCount/__docs__/example.stories.tsx +++ b/src/useRenderCount/__docs__/example.stories.tsx @@ -1,4 +1,4 @@ -import { useRerender, useRenderCount } from '#root/index.js'; +import { useRerender, useRenderCount } from '../../index.js'; export function Example() { const renders = useRenderCount(); diff --git a/src/useRenderCount/__tests__/dom.ts b/src/useRenderCount/__tests__/dom.ts index 07f2c7e7b..e70490822 100644 --- a/src/useRenderCount/__tests__/dom.ts +++ b/src/useRenderCount/__tests__/dom.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks'; -import { useRenderCount } from '#root/index.js'; +import { useRenderCount } from '../../index.js'; describe('useRendersCount', () => { it('should be defined', () => { diff --git a/src/useRenderCount/__tests__/ssr.ts b/src/useRenderCount/__tests__/ssr.ts index 348773b29..db6fdb3c9 100644 --- a/src/useRenderCount/__tests__/ssr.ts +++ b/src/useRenderCount/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useRenderCount } from '#root/index.js'; +import { useRenderCount } from '../../index.js'; describe('useRendersCount', () => { it('should be defined', () => { diff --git a/src/useRerender/__docs__/example.stories.tsx b/src/useRerender/__docs__/example.stories.tsx index d78640a8b..7a8da9944 100644 --- a/src/useRerender/__docs__/example.stories.tsx +++ b/src/useRerender/__docs__/example.stories.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { useRenderCount, useRerender } from '#root/index.js'; +import { useRenderCount, useRerender } from '../../index.js'; export function Example() { const renders = useRenderCount(); diff --git a/src/useRerender/__tests__/dom.ts b/src/useRerender/__tests__/dom.ts index 7a2c8f1bc..dd3f3cbd7 100644 --- a/src/useRerender/__tests__/dom.ts +++ b/src/useRerender/__tests__/dom.ts @@ -1,6 +1,6 @@ import { act, renderHook } from '@testing-library/react-hooks/dom'; import { useRef } from 'react'; -import { useRerender } from '#root/index.js'; +import { useRerender } from '../../index.js'; describe('useRerender', () => { it('should be defined', () => { diff --git a/src/useRerender/__tests__/ssr.ts b/src/useRerender/__tests__/ssr.ts index 5255e5166..ac93df857 100644 --- a/src/useRerender/__tests__/ssr.ts +++ b/src/useRerender/__tests__/ssr.ts @@ -1,6 +1,6 @@ import { act, renderHook } from '@testing-library/react-hooks/server'; import { useRef } from 'react'; -import { useRerender } from '#root/index.js'; +import { useRerender } from '../../index.js'; describe('useRerender', () => { it('should be defined', () => { diff --git a/src/useResizeObserver/__docs__/example.stories.tsx b/src/useResizeObserver/__docs__/example.stories.tsx index 071963639..9859e9aa5 100644 --- a/src/useResizeObserver/__docs__/example.stories.tsx +++ b/src/useResizeObserver/__docs__/example.stories.tsx @@ -4,7 +4,7 @@ import { type UseResizeObserverCallback, useDebouncedCallback, useResizeObserver, -} from '#root/index.js'; +} from '../../index.js'; export function Example() { const ref = useRef(null); diff --git a/src/useResizeObserver/__tests__/dom.ts b/src/useResizeObserver/__tests__/dom.ts index 16ef940f3..e27291e25 100644 --- a/src/useResizeObserver/__tests__/dom.ts +++ b/src/useResizeObserver/__tests__/dom.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/dom'; -import { useResizeObserver } from '#root/index.js'; +import { useResizeObserver } from '../../index.js'; import Mock = jest.Mock; describe('useResizeObserver', () => { diff --git a/src/useResizeObserver/__tests__/ssr.ts b/src/useResizeObserver/__tests__/ssr.ts index 1f4bbb0b4..e971cd975 100644 --- a/src/useResizeObserver/__tests__/ssr.ts +++ b/src/useResizeObserver/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useResizeObserver } from '#root/index.js'; +import { useResizeObserver } from '../../index.js'; describe('useResizeObserver', () => { it('should be defined', () => { diff --git a/src/useResizeObserver/index.ts b/src/useResizeObserver/index.ts index 5f15f49ec..4611a72ea 100644 --- a/src/useResizeObserver/index.ts +++ b/src/useResizeObserver/index.ts @@ -1,6 +1,6 @@ import { type RefObject, useEffect } from 'react'; -import { useSyncedRef } from '#root/useSyncedRef/index.js'; -import { isBrowser } from '#root/util/const.js'; +import { useSyncedRef } from '../useSyncedRef/index.js'; +import { isBrowser } from '../util/const.js'; export type UseResizeObserverCallback = (entry: ResizeObserverEntry) => void; diff --git a/src/useScreenOrientation/__docs__/example.stories.tsx b/src/useScreenOrientation/__docs__/example.stories.tsx index fa7943788..c61ceeae7 100644 --- a/src/useScreenOrientation/__docs__/example.stories.tsx +++ b/src/useScreenOrientation/__docs__/example.stories.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { useScreenOrientation } from '#root/index.js'; +import { useScreenOrientation } from '../../index.js'; export function Example() { const orientation = useScreenOrientation(); diff --git a/src/useScreenOrientation/__tests__/dom.ts b/src/useScreenOrientation/__tests__/dom.ts index aa73b786d..94d3bc463 100644 --- a/src/useScreenOrientation/__tests__/dom.ts +++ b/src/useScreenOrientation/__tests__/dom.ts @@ -1,5 +1,5 @@ import { act, renderHook } from '@testing-library/react-hooks/dom'; -import { useScreenOrientation } from '#root/index.js'; +import { useScreenOrientation } from '../../index.js'; describe('useScreenOrientation', () => { // Have to copy implementation as jsdom lacks of it diff --git a/src/useScreenOrientation/__tests__/ssr.ts b/src/useScreenOrientation/__tests__/ssr.ts index 4bbcff83e..5f1030a47 100644 --- a/src/useScreenOrientation/__tests__/ssr.ts +++ b/src/useScreenOrientation/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useScreenOrientation } from '#root/index.js'; +import { useScreenOrientation } from '../../index.js'; describe('useScreenOrientation', () => { it('should be defined', () => { diff --git a/src/useScreenOrientation/index.ts b/src/useScreenOrientation/index.ts index 9a5b65f43..020ab4dac 100644 --- a/src/useScreenOrientation/index.ts +++ b/src/useScreenOrientation/index.ts @@ -1,4 +1,4 @@ -import { useMediaQuery } from '#root/useMediaQuery/index.js'; +import { useMediaQuery } from '../useMediaQuery/index.js'; export type ScreenOrientation = 'portrait' | 'landscape'; diff --git a/src/useSessionStorageValue/__docs__/example.stories.tsx b/src/useSessionStorageValue/__docs__/example.stories.tsx index 82847d681..7bc61f07f 100644 --- a/src/useSessionStorageValue/__docs__/example.stories.tsx +++ b/src/useSessionStorageValue/__docs__/example.stories.tsx @@ -1,4 +1,4 @@ -import { useSessionStorageValue } from '#root/index.js'; +import { useSessionStorageValue } from '../../index.js'; type ExampleProps = { /** diff --git a/src/useSessionStorageValue/__tests__/dom.ts b/src/useSessionStorageValue/__tests__/dom.ts index cd5020bd6..240c2d406 100644 --- a/src/useSessionStorageValue/__tests__/dom.ts +++ b/src/useSessionStorageValue/__tests__/dom.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/dom'; -import { useSessionStorageValue } from '#root/index.js'; +import { useSessionStorageValue } from '../../index.js'; describe('useSessionStorageValue', () => { it('should be defined', () => { diff --git a/src/useSessionStorageValue/__tests__/ssr.ts b/src/useSessionStorageValue/__tests__/ssr.ts index 554a6a767..6765a375d 100644 --- a/src/useSessionStorageValue/__tests__/ssr.ts +++ b/src/useSessionStorageValue/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useSessionStorageValue } from '#root/index.js'; +import { useSessionStorageValue } from '../../index.js'; describe('useSessionStorageValue', () => { it('should be defined', () => { diff --git a/src/useSessionStorageValue/index.ts b/src/useSessionStorageValue/index.ts index 0decef932..3df9f31ca 100644 --- a/src/useSessionStorageValue/index.ts +++ b/src/useSessionStorageValue/index.ts @@ -2,8 +2,8 @@ import { useStorageValue, type UseStorageValueOptions, type UseStorageValueResult, -} from '#root/useStorageValue/index.js'; -import { isBrowser, noop } from '#root/util/const.js'; +} from '../useStorageValue/index.js'; +import { isBrowser, noop } from '../util/const.js'; let IS_SESSION_STORAGE_AVAILABLE: boolean; diff --git a/src/useSet/__docs__/example.stories.tsx b/src/useSet/__docs__/example.stories.tsx index 00ddd9222..2ab92920c 100644 --- a/src/useSet/__docs__/example.stories.tsx +++ b/src/useSet/__docs__/example.stories.tsx @@ -1,6 +1,6 @@ /* eslint-disable react/no-unescaped-entities */ import * as React from 'react'; -import { useSet } from '#root/index.js'; +import { useSet } from '../../index.js'; export function Example() { const set = useSet(['@react-hooks', 'is awesome']); diff --git a/src/useSet/__tests__/dom.ts b/src/useSet/__tests__/dom.ts index 341f3ddc9..6cffa389b 100644 --- a/src/useSet/__tests__/dom.ts +++ b/src/useSet/__tests__/dom.ts @@ -1,5 +1,5 @@ import { act, renderHook } from '@testing-library/react-hooks/dom'; -import { useSet } from '#root/index.js'; +import { useSet } from '../../index.js'; describe('useSet', () => { it('should be defined', () => { diff --git a/src/useSet/__tests__/ssr.ts b/src/useSet/__tests__/ssr.ts index 6d2c4098b..efbc2b452 100644 --- a/src/useSet/__tests__/ssr.ts +++ b/src/useSet/__tests__/ssr.ts @@ -1,6 +1,6 @@ import { act } from '@testing-library/react-hooks/dom'; import { renderHook } from '@testing-library/react-hooks/server'; -import { useSet } from '#root/index.js'; +import { useSet } from '../../index.js'; describe('useSet', () => { it('should be defined', () => { diff --git a/src/useSet/index.ts b/src/useSet/index.ts index b9e69dd37..4976a3e1f 100644 --- a/src/useSet/index.ts +++ b/src/useSet/index.ts @@ -1,5 +1,5 @@ import { useRef } from 'react'; -import { useRerender } from '#root/useRerender/index.js'; +import { useRerender } from '../useRerender/index.js'; const proto = Set.prototype; diff --git a/src/useStorageValue/index.ts b/src/useStorageValue/index.ts index bd67933d0..fb5e71db9 100644 --- a/src/useStorageValue/index.ts +++ b/src/useStorageValue/index.ts @@ -1,11 +1,11 @@ import { useEffect, useMemo, useState } from 'react'; -import { useFirstMountState } from '#root/useFirstMountState/index.js'; -import { useIsomorphicLayoutEffect } from '#root/useIsomorphicLayoutEffect/index.js'; -import { useSyncedRef } from '#root/useSyncedRef/index.js'; -import { useUpdateEffect } from '#root/useUpdateEffect/index.js'; -import { isBrowser } from '#root/util/const.js'; -import { off, on } from '#root/util/misc.js'; -import { type NextState, resolveHookState } from '#root/util/resolveHookState.js'; +import { useFirstMountState } from '../useFirstMountState/index.js'; +import { useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect/index.js'; +import { useSyncedRef } from '../useSyncedRef/index.js'; +import { useUpdateEffect } from '../useUpdateEffect/index.js'; +import { isBrowser } from '../util/const.js'; +import { off, on } from '../util/misc.js'; +import { type NextState, resolveHookState } from '../util/resolveHookState.js'; const storageListeners = new Map>>(); diff --git a/src/useSyncedRef/__docs__/example.stories.tsx b/src/useSyncedRef/__docs__/example.stories.tsx index 2face9c46..07af9e37a 100644 --- a/src/useSyncedRef/__docs__/example.stories.tsx +++ b/src/useSyncedRef/__docs__/example.stories.tsx @@ -1,5 +1,5 @@ import { useRef } from 'react'; -import { useRerender, useSyncedRef } from '#root/index.js'; +import { useRerender, useSyncedRef } from '../../index.js'; export function Example() { const ref = useRef(0); diff --git a/src/useSyncedRef/__tests__/dom.ts b/src/useSyncedRef/__tests__/dom.ts index 8caa8f2b7..4b37930d1 100644 --- a/src/useSyncedRef/__tests__/dom.ts +++ b/src/useSyncedRef/__tests__/dom.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/dom'; -import { useSyncedRef } from '#root/index.js'; +import { useSyncedRef } from '../../index.js'; describe('useSyncedRef', () => { it('should be defined', () => { diff --git a/src/useSyncedRef/__tests__/ssr.ts b/src/useSyncedRef/__tests__/ssr.ts index b963b0660..4b0b9582f 100644 --- a/src/useSyncedRef/__tests__/ssr.ts +++ b/src/useSyncedRef/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useSyncedRef } from '#root/index.js'; +import { useSyncedRef } from '../../index.js'; describe('useSyncedRef', () => { it('should be defined', () => { diff --git a/src/useThrottledCallback/__docs__/example.stories.tsx b/src/useThrottledCallback/__docs__/example.stories.tsx index 016345740..1459d707c 100644 --- a/src/useThrottledCallback/__docs__/example.stories.tsx +++ b/src/useThrottledCallback/__docs__/example.stories.tsx @@ -1,5 +1,5 @@ import { type ComponentProps, useState } from 'react'; -import { useThrottledCallback } from '#root/index.js'; +import { useThrottledCallback } from '../../index.js'; export function Example() { const [state, setState] = useState(''); diff --git a/src/useThrottledCallback/__tests__/dom.ts b/src/useThrottledCallback/__tests__/dom.ts index 732b2a816..eeb9e3bd5 100644 --- a/src/useThrottledCallback/__tests__/dom.ts +++ b/src/useThrottledCallback/__tests__/dom.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/dom'; -import { useThrottledCallback } from '#root/index.js'; +import { useThrottledCallback } from '../../index.js'; function testFn(_a: any, _b: any, _c: any) {} diff --git a/src/useThrottledCallback/__tests__/ssr.ts b/src/useThrottledCallback/__tests__/ssr.ts index 4558bf865..06f6a8447 100644 --- a/src/useThrottledCallback/__tests__/ssr.ts +++ b/src/useThrottledCallback/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useThrottledCallback } from '#root/index.js'; +import { useThrottledCallback } from '../../index.js'; describe('useThrottledCallback', () => { beforeAll(() => { diff --git a/src/useThrottledCallback/index.ts b/src/useThrottledCallback/index.ts index e1aafdf6f..c8965bc15 100644 --- a/src/useThrottledCallback/index.ts +++ b/src/useThrottledCallback/index.ts @@ -1,5 +1,5 @@ import { type DependencyList, useMemo, useRef } from 'react'; -import { useUnmountEffect } from '#root/useUnmountEffect/index.js'; +import { useUnmountEffect } from '../useUnmountEffect/index.js'; export type ThrottledFunction any> = ( this: ThisParameterType, diff --git a/src/useThrottledEffect/__docs__/example.stories.tsx b/src/useThrottledEffect/__docs__/example.stories.tsx index 88daa5ee9..5545ffce9 100644 --- a/src/useThrottledEffect/__docs__/example.stories.tsx +++ b/src/useThrottledEffect/__docs__/example.stories.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { useState } from 'react'; -import { useThrottledEffect } from '#root/index.js'; +import { useThrottledEffect } from '../../index.js'; const HAS_DIGIT_REGEX = /\d/g; diff --git a/src/useThrottledEffect/__tests__/dom.ts b/src/useThrottledEffect/__tests__/dom.ts index 25e518d80..ca6633fcd 100644 --- a/src/useThrottledEffect/__tests__/dom.ts +++ b/src/useThrottledEffect/__tests__/dom.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/dom'; -import { useThrottledEffect } from '#root/index.js'; +import { useThrottledEffect } from '../../index.js'; describe('useThrottledEffect', () => { beforeAll(() => { diff --git a/src/useThrottledEffect/__tests__/ssr.ts b/src/useThrottledEffect/__tests__/ssr.ts index 59b9f4417..0359b8007 100644 --- a/src/useThrottledEffect/__tests__/ssr.ts +++ b/src/useThrottledEffect/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useThrottledEffect } from '#root/index.js'; +import { useThrottledEffect } from '../../index.js'; describe('useThrottledEffect', () => { beforeAll(() => { diff --git a/src/useThrottledEffect/index.ts b/src/useThrottledEffect/index.ts index 2fc5b5ece..39606f3ac 100644 --- a/src/useThrottledEffect/index.ts +++ b/src/useThrottledEffect/index.ts @@ -1,5 +1,5 @@ import { type DependencyList, useEffect } from 'react'; -import { useThrottledCallback } from '#root/useThrottledCallback/index.js'; +import { useThrottledCallback } from '../useThrottledCallback/index.js'; /** * Like `useEffect`, but passed function is throttled. diff --git a/src/useThrottledState/__docs__/example.stories.tsx b/src/useThrottledState/__docs__/example.stories.tsx index ff425793f..8d96dcc7f 100644 --- a/src/useThrottledState/__docs__/example.stories.tsx +++ b/src/useThrottledState/__docs__/example.stories.tsx @@ -1,4 +1,4 @@ -import { useThrottledState } from '#root/index.js'; +import { useThrottledState } from '../../index.js'; export function Example() { const [state, setState] = useThrottledState('', 500); diff --git a/src/useThrottledState/__tests__/dom.ts b/src/useThrottledState/__tests__/dom.ts index 9bc5dedd1..fd69b396a 100644 --- a/src/useThrottledState/__tests__/dom.ts +++ b/src/useThrottledState/__tests__/dom.ts @@ -1,5 +1,5 @@ import { renderHook, act } from '@testing-library/react-hooks/dom'; -import { useThrottledState } from '#root/index.js'; +import { useThrottledState } from '../../index.js'; describe('useThrottledState', () => { beforeAll(() => { diff --git a/src/useThrottledState/__tests__/ssr.ts b/src/useThrottledState/__tests__/ssr.ts index 41a69968b..d9410c785 100644 --- a/src/useThrottledState/__tests__/ssr.ts +++ b/src/useThrottledState/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useThrottledState } from '#root/index.js'; +import { useThrottledState } from '../../index.js'; describe('useThrottledState', () => { beforeAll(() => { diff --git a/src/useThrottledState/index.ts b/src/useThrottledState/index.ts index b7aac8b43..cef465c11 100644 --- a/src/useThrottledState/index.ts +++ b/src/useThrottledState/index.ts @@ -1,5 +1,5 @@ import { type Dispatch, type SetStateAction, useState } from 'react'; -import { useThrottledCallback } from '#root/useThrottledCallback/index.js'; +import { useThrottledCallback } from '../useThrottledCallback/index.js'; /** * Like `useState` but its state setter is throttled. diff --git a/src/useTimeoutEffect/__docs__/example.stories.tsx b/src/useTimeoutEffect/__docs__/example.stories.tsx index ab6b87dac..fd608338e 100644 --- a/src/useTimeoutEffect/__docs__/example.stories.tsx +++ b/src/useTimeoutEffect/__docs__/example.stories.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { useState } from 'react'; -import { useTimeoutEffect, useToggle } from '#root/index.js'; +import { useTimeoutEffect, useToggle } from '../../index.js'; export function Example() { const [numberCalls, setNumberCalls] = useState(0); diff --git a/src/useTimeoutEffect/__tests__/dom.ts b/src/useTimeoutEffect/__tests__/dom.ts index b08a9037a..025ad519e 100644 --- a/src/useTimeoutEffect/__tests__/dom.ts +++ b/src/useTimeoutEffect/__tests__/dom.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/dom'; -import { useTimeoutEffect } from '#root/index.js'; +import { useTimeoutEffect } from '../../index.js'; describe('useTimeoutEffect', () => { beforeAll(() => { diff --git a/src/useTimeoutEffect/__tests__/ssr.ts b/src/useTimeoutEffect/__tests__/ssr.ts index d621fefe9..7d7728d82 100644 --- a/src/useTimeoutEffect/__tests__/ssr.ts +++ b/src/useTimeoutEffect/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useTimeoutEffect } from '#root/index.js'; +import { useTimeoutEffect } from '../../index.js'; describe('useTimeoutEffect', () => { beforeAll(() => { diff --git a/src/useTimeoutEffect/index.ts b/src/useTimeoutEffect/index.ts index 0d60d8701..98e4966eb 100644 --- a/src/useTimeoutEffect/index.ts +++ b/src/useTimeoutEffect/index.ts @@ -1,5 +1,5 @@ import { useCallback, useEffect, useRef } from 'react'; -import { useSyncedRef } from '#root/useSyncedRef/index.js'; +import { useSyncedRef } from '../useSyncedRef/index.js'; type TimeoutID = ReturnType | null; diff --git a/src/useToggle/__docs__/example.stories.tsx b/src/useToggle/__docs__/example.stories.tsx index 798fbbab7..eef360336 100644 --- a/src/useToggle/__docs__/example.stories.tsx +++ b/src/useToggle/__docs__/example.stories.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { useToggle } from '#root/index.js'; +import { useToggle } from '../../index.js'; export function Example() { const [isToggled, toggle] = useToggle(true); diff --git a/src/useToggle/__tests__/dom.ts b/src/useToggle/__tests__/dom.ts index a024c6525..5b10a6cf1 100644 --- a/src/useToggle/__tests__/dom.ts +++ b/src/useToggle/__tests__/dom.ts @@ -1,6 +1,6 @@ import { act, renderHook } from '@testing-library/react-hooks/dom'; import { type BaseSyntheticEvent, useRef } from 'react'; -import { useToggle } from '#root/index.js'; +import { useToggle } from '../../index.js'; describe('useToggle', () => { it('should be defined', () => { diff --git a/src/useToggle/__tests__/ssr.ts b/src/useToggle/__tests__/ssr.ts index 45411ef5e..7f1a3f2df 100644 --- a/src/useToggle/__tests__/ssr.ts +++ b/src/useToggle/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { act, renderHook } from '@testing-library/react-hooks/server'; -import { useToggle } from '#root/index.js'; +import { useToggle } from '../../index.js'; describe('useToggle', () => { it('should be defined', () => { diff --git a/src/useToggle/index.ts b/src/useToggle/index.ts index e05d2a9cb..7e035c1d5 100644 --- a/src/useToggle/index.ts +++ b/src/useToggle/index.ts @@ -1,10 +1,6 @@ import { type BaseSyntheticEvent, useCallback, useState } from 'react'; -import { useSyncedRef } from '#root/useSyncedRef/index.js'; -import { - type InitialState, - type NextState, - resolveHookState, -} from '#root/util/resolveHookState.js'; +import { useSyncedRef } from '../useSyncedRef/index.js'; +import { type InitialState, type NextState, resolveHookState } from '../util/resolveHookState.js'; export function useToggle( initialState: InitialState, diff --git a/src/useUnmountEffect/__docs__/example.stories.tsx b/src/useUnmountEffect/__docs__/example.stories.tsx index d5b787df0..fc2560f1f 100644 --- a/src/useUnmountEffect/__docs__/example.stories.tsx +++ b/src/useUnmountEffect/__docs__/example.stories.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { useToggle, useUnmountEffect } from '#root/index.js'; +import { useToggle, useUnmountEffect } from '../../index.js'; export function Example() { const [isToggled, toggle] = useToggle(false); diff --git a/src/useUnmountEffect/__tests__/dom.ts b/src/useUnmountEffect/__tests__/dom.ts index cc8e07612..2f7438952 100644 --- a/src/useUnmountEffect/__tests__/dom.ts +++ b/src/useUnmountEffect/__tests__/dom.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/dom'; -import { useUnmountEffect } from '#root/index.js'; +import { useUnmountEffect } from '../../index.js'; describe('useUnmountEffect', () => { it('should call effector only when component unmounted', () => { diff --git a/src/useUnmountEffect/__tests__/ssr.ts b/src/useUnmountEffect/__tests__/ssr.ts index 671974245..8959a65de 100644 --- a/src/useUnmountEffect/__tests__/ssr.ts +++ b/src/useUnmountEffect/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useUnmountEffect } from '#root/index.js'; +import { useUnmountEffect } from '../../index.js'; describe('useUnmountEffect', () => { it('should call effector only when component unmounted', () => { diff --git a/src/useUnmountEffect/index.ts b/src/useUnmountEffect/index.ts index a1a34d0f1..3a0dcb524 100644 --- a/src/useUnmountEffect/index.ts +++ b/src/useUnmountEffect/index.ts @@ -1,5 +1,5 @@ import { useEffect } from 'react'; -import { useSyncedRef } from '#root/useSyncedRef/index.js'; +import { useSyncedRef } from '../useSyncedRef/index.js'; /** * Run effect only when component is unmounted. diff --git a/src/useUpdateEffect/__docs__/example.stories.tsx b/src/useUpdateEffect/__docs__/example.stories.tsx index 6853391ee..45de07dca 100644 --- a/src/useUpdateEffect/__docs__/example.stories.tsx +++ b/src/useUpdateEffect/__docs__/example.stories.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { useState } from 'react'; -import { useRerender, useUpdateEffect } from '#root/index.js'; +import { useRerender, useUpdateEffect } from '../../index.js'; export function Example() { const [count, setCount] = useState(1); diff --git a/src/useUpdateEffect/__tests__/dom.ts b/src/useUpdateEffect/__tests__/dom.ts index 76f0aa272..15ad9c55d 100644 --- a/src/useUpdateEffect/__tests__/dom.ts +++ b/src/useUpdateEffect/__tests__/dom.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/dom'; -import { useUpdateEffect } from '#root/index.js'; +import { useUpdateEffect } from '../../index.js'; describe('useUpdateEffect', () => { it('should call effector only on updates (after first render)', () => { diff --git a/src/useUpdateEffect/__tests__/ssr.ts b/src/useUpdateEffect/__tests__/ssr.ts index 6905e41f6..ee5f014fa 100644 --- a/src/useUpdateEffect/__tests__/ssr.ts +++ b/src/useUpdateEffect/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useUpdateEffect } from '#root/index.js'; +import { useUpdateEffect } from '../../index.js'; describe('useUpdateEffect', () => { it('should not call effector on mount', () => { diff --git a/src/useUpdateEffect/index.ts b/src/useUpdateEffect/index.ts index 36e742ede..090c4cfb4 100644 --- a/src/useUpdateEffect/index.ts +++ b/src/useUpdateEffect/index.ts @@ -1,6 +1,6 @@ import { type DependencyList, type EffectCallback, useEffect } from 'react'; -import { useFirstMountState } from '#root/useFirstMountState/index.js'; -import { noop } from '#root/util/const.js'; +import { useFirstMountState } from '../useFirstMountState/index.js'; +import { noop } from '../util/const.js'; /** * Effect hook that ignores the first render (not invoked on mount). diff --git a/src/useValidator/__docs__/example.tsx b/src/useValidator/__docs__/example.tsx index 4e1d5e91f..a2a11de7c 100644 --- a/src/useValidator/__docs__/example.tsx +++ b/src/useValidator/__docs__/example.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { useState } from 'react'; -import { type ValidatorDeferred, useDebouncedCallback, useValidator } from '#root/index.js'; +import { type ValidatorDeferred, useDebouncedCallback, useValidator } from '../../index.js'; export function Example() { const [text, setText] = useState(''); diff --git a/src/useValidator/__tests__/dom.ts b/src/useValidator/__tests__/dom.ts index 05cd8e40e..95891f480 100644 --- a/src/useValidator/__tests__/dom.ts +++ b/src/useValidator/__tests__/dom.ts @@ -1,5 +1,5 @@ import { act, renderHook } from '@testing-library/react-hooks/dom'; -import { useValidator, type UseValidatorReturn } from '#root/index.js'; +import { useValidator, type UseValidatorReturn } from '../../index.js'; describe('useValidator', () => { it('should be defined', () => { diff --git a/src/useValidator/__tests__/ssr.ts b/src/useValidator/__tests__/ssr.ts index b245a8385..5c4495502 100644 --- a/src/useValidator/__tests__/ssr.ts +++ b/src/useValidator/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useValidator } from '#root/index.js'; +import { useValidator } from '../../index.js'; describe('useValidator', () => { it('should be defined', () => { diff --git a/src/useValidator/index.ts b/src/useValidator/index.ts index a7421a7f4..21721cde7 100644 --- a/src/useValidator/index.ts +++ b/src/useValidator/index.ts @@ -1,6 +1,6 @@ import { type DependencyList, type Dispatch, useCallback, useEffect, useState } from 'react'; -import { useSyncedRef } from '#root/useSyncedRef/index.js'; -import { type InitialState, type NextState } from '#root/util/resolveHookState.js'; +import { useSyncedRef } from '../useSyncedRef/index.js'; +import { type InitialState, type NextState } from '../util/resolveHookState.js'; export type ValidityState = { isValid: boolean | undefined; diff --git a/src/useVibrate/__docs__/example.stories.tsx b/src/useVibrate/__docs__/example.stories.tsx index 0fc6572f9..375307d93 100644 --- a/src/useVibrate/__docs__/example.stories.tsx +++ b/src/useVibrate/__docs__/example.stories.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { useToggle, useVibrate } from '#root/index.js'; +import { useToggle, useVibrate } from '../../index.js'; export function Example() { const [doVibrate, setDoVibrate] = useToggle(false); diff --git a/src/useVibrate/__tests__/dom.ts b/src/useVibrate/__tests__/dom.ts index 60ce9c9f3..c7c57a15b 100644 --- a/src/useVibrate/__tests__/dom.ts +++ b/src/useVibrate/__tests__/dom.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/dom'; -import { useVibrate } from '#root/index.js'; +import { useVibrate } from '../../index.js'; describe('useVibrate', () => { const vibrateSpy = jest.spyOn(navigator, 'vibrate'); diff --git a/src/useVibrate/__tests__/ssr.ts b/src/useVibrate/__tests__/ssr.ts index 1aa7e8ef2..934ea2c03 100644 --- a/src/useVibrate/__tests__/ssr.ts +++ b/src/useVibrate/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useVibrate } from '#root/index.js'; +import { useVibrate } from '../../index.js'; describe('useVibrate', () => { it('should be defined', () => { diff --git a/src/useVibrate/index.ts b/src/useVibrate/index.ts index 063e6dd7f..91f2d9718 100644 --- a/src/useVibrate/index.ts +++ b/src/useVibrate/index.ts @@ -1,5 +1,5 @@ import { useEffect } from 'react'; -import { isBrowser, noop } from '#root/util/const.js'; +import { isBrowser, noop } from '../util/const.js'; /** * Provides vibration feedback using the Vibration API. diff --git a/src/useWindowSize/__docs__/example.stories.tsx b/src/useWindowSize/__docs__/example.stories.tsx index 643b6732e..0f908e7b7 100644 --- a/src/useWindowSize/__docs__/example.stories.tsx +++ b/src/useWindowSize/__docs__/example.stories.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { useWindowSize } from '#root/index.js'; +import { useWindowSize } from '../../index.js'; export function Example() { const size = useWindowSize(); diff --git a/src/useWindowSize/__tests__/dom.ts b/src/useWindowSize/__tests__/dom.ts index 379260d2d..9117c3839 100644 --- a/src/useWindowSize/__tests__/dom.ts +++ b/src/useWindowSize/__tests__/dom.ts @@ -1,6 +1,6 @@ import { act, renderHook } from '@testing-library/react-hooks/dom'; import { useState } from 'react'; -import { useWindowSize, type WindowSize } from '#root/index.js'; +import { useWindowSize, type WindowSize } from '../../index.js'; const triggerResize = (dimension: 'width' | 'height', value: number) => { if (dimension === 'width') { diff --git a/src/useWindowSize/__tests__/ssr.ts b/src/useWindowSize/__tests__/ssr.ts index b0aeeb7d5..abe911e45 100644 --- a/src/useWindowSize/__tests__/ssr.ts +++ b/src/useWindowSize/__tests__/ssr.ts @@ -1,5 +1,5 @@ import { renderHook } from '@testing-library/react-hooks/server'; -import { useWindowSize } from '#root/index.js'; +import { useWindowSize } from '../../index.js'; describe('useWindowSize', () => { it('should be defined', () => { diff --git a/src/useWindowSize/index.ts b/src/useWindowSize/index.ts index 23fe9897f..f6d2cd196 100644 --- a/src/useWindowSize/index.ts +++ b/src/useWindowSize/index.ts @@ -1,8 +1,8 @@ import { useEffect } from 'react'; -import { useFirstMountState } from '#root/useFirstMountState/index.js'; -import { useMountEffect } from '#root/useMountEffect/index.js'; -import { useRafState } from '#root/useRafState/index.js'; -import { isBrowser } from '#root/util/const.js'; +import { useFirstMountState } from '../useFirstMountState/index.js'; +import { useMountEffect } from '../useMountEffect/index.js'; +import { useRafState } from '../useRafState/index.js'; +import { isBrowser } from '../util/const.js'; export type WindowSize = { width: number; diff --git a/src/util/__tests__/dom.ts b/src/util/__tests__/dom.ts index c34d01024..c2ddf6c85 100644 --- a/src/util/__tests__/dom.ts +++ b/src/util/__tests__/dom.ts @@ -1,5 +1,5 @@ /* eslint-disable max-nested-callbacks */ -import { resolveHookState } from '#root/index.js'; +import { resolveHookState } from '../../index.js'; import { basicDepsComparator, off, on } from '../misc.js'; describe('resolveHookState', () => { diff --git a/src/util/const.ts b/src/util/const.ts index 2cb00ec48..f0b7a65fc 100644 --- a/src/util/const.ts +++ b/src/util/const.ts @@ -1,4 +1,4 @@ -import { type Predicate, type ConditionsPredicate } from '#root/types.js'; +import { type Predicate, type ConditionsPredicate } from '../types.js'; export const noop = (): void => {}; diff --git a/src/util/misc.ts b/src/util/misc.ts index b69469b5b..b882b06ec 100644 --- a/src/util/misc.ts +++ b/src/util/misc.ts @@ -1,5 +1,5 @@ import { type DependencyList } from 'react'; -import { type DependenciesComparator } from '#root/types.js'; +import { type DependenciesComparator } from '../types.js'; export function on( object: T | null,