UNPKG

state-in-url

Version:

Store state in URL as in object, types and structure are preserved, with TS validation. Same API as React.useState, wthout any hasssle or boilerplate. Next.js@14-15 and react-router@6-7.

10 lines (9 loc) 531 B
import { decode, encode } from "./encoder"; import { decodeState, encodeState } from "./encodeState"; import { useUrlState } from "./next"; import { useSharedState } from "./useSharedState"; import { useUrlEncode } from "./useUrlEncode"; import { useUrlStateBase } from "./useUrlStateBase"; import { isSSR, type JSONCompatible, type Type, typeOf } from "./utils"; export { decode, decodeState, encode, encodeState, isSSR, typeOf, useSharedState, useUrlEncode, useUrlState, useUrlStateBase, }; export type { JSONCompatible, Type };