mirror of
https://github.com/streamich/react-use.git
synced 2026-02-01 14:37:31 +00:00
Merge branch 'grantila-master'
This commit is contained in:
commit
1d288b97a8
@ -1,10 +1,10 @@
|
|||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { resolveHookState, IHookStateSetAction } from '../misc/hookState';
|
import { IHookStateInitAction, IHookStateSetAction, resolveHookState } from '../misc/hookState';
|
||||||
import useEffectOnce from '../useEffectOnce';
|
import useEffectOnce from '../useEffectOnce';
|
||||||
import useIsomorphicLayoutEffect from '../useIsomorphicLayoutEffect';
|
import useIsomorphicLayoutEffect from '../useIsomorphicLayoutEffect';
|
||||||
|
|
||||||
export function createGlobalState<S = any>(
|
export function createGlobalState<S = any>(
|
||||||
initialState: S | (() => S)
|
initialState: IHookStateInitAction<S>
|
||||||
): () => [S, (state: IHookStateSetAction<S>) => void];
|
): () => [S, (state: IHookStateSetAction<S>) => void];
|
||||||
export function createGlobalState<S = undefined>(): () => [
|
export function createGlobalState<S = undefined>(): () => [
|
||||||
S,
|
S,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user