Skip to Content

Getting Started

Installation

Inside your React project directory, run the following:

pnpm

pnpm add foxact

yarn

yarn add foxact

npm

npm i foxact

Usage Example

Simply importing the functions you need from foxact:

src/context/sidebar-active-provider.tsx
import { createContextState } from 'foxact/context-state'; const [SidebarActiveProvider, useSidebarActive, useSetSidebarActive] = createContextState(false); export { SidebarActiveProvider, useSidebarActive, useSetSidebarActive };
src/App.tsx
import { SidebarActiveProvider } from './context/sidebar-active-provider'; export default function App() { return ( <SidebarActiveProvider> <Component /> </SidebarActiveProvider> ); }

And here you go!