Getting Started
Installation
Inside your React project directory, run the following:
pnpm
pnpm add foxactyarn
yarn add foxactnpm
npm i foxactUsage 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!