layout-context.ts 399 B

123456789101112131415161718
  1. import React from 'react';
  2. import { noop } from '@douyinfe/semi-foundation/utils/function';
  3. export interface ContextType {
  4. siderHook: {
  5. addSider: (id: string) => void;
  6. removeSider: (id: string) => void
  7. }
  8. }
  9. const LayoutContext = React.createContext<ContextType>({
  10. siderHook: {
  11. addSider: noop,
  12. removeSider: noop,
  13. },
  14. });
  15. export default LayoutContext;