UNPKG

react-auth-kit

Version:

Authentication Library for React, which makes Token based auth very easy

45 lines (44 loc) 1.09 kB
import * as React from 'react'; import type { createStoreReturn } from './createStore'; /** * Props of the AuthProvider Component */ interface AuthProviderProps<T> { /** * Auth Kit Store. * * Create the store using the `createStore` function */ store: createStoreReturn<T>; /** * React Component. * Effectively your entine application */ children: React.ReactNode; } /** * * React Provider that includes React Auth Kit functionality in your React * Application. * * @returns React Functional component with React Auth Kit Recharged. * * @remarks * Make sure you wrap your application as well as your * router components in AuthProvider. * * AuthProvider should be your Topmost element so that it can work effectively * throughout the application. * * @example * ```jsx * const store = createStore() * * <AuthProvider store={store}> * <RoutesComponent/> * </AuthProvider> * ``` * */ declare function AuthProvider<T>({ store, children, }: AuthProviderProps<T>): ReturnType<React.FC>; export default AuthProvider;