$ npm install --save @rootsher/use-sheets-queue
- sheets provider:
import { SheetsProvider } from '@rootsher/use-sheets-queue';
function Main() {
return (
<SheetsProvider>
{/* App */}
</SheetsProvider>
);
}
- sheets management (LIFO - push, pop):
import { useSheetsQueue } from '@rootsher/use-sheets-queue';
import { A } from './sheets';
function App() {
const [ push ] = useSheetsQueue();
return (
<Button onClick={() => push(A)}>push</Button>
);
}
type Options = {
side?: 'left' | 'right' | 'bottom' | 'top';
size?: number;
};
function push(Element, options?: Options, previousOptions?: Options);
function pop();