Skip to content

Commit

Permalink
perf(tabs): perf multiple-tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
anncwb committed Dec 13, 2020
1 parent 27e50b4 commit f81c401
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 95 deletions.
17 changes: 0 additions & 17 deletions src/layouts/default/index.less

This file was deleted.

75 changes: 0 additions & 75 deletions src/layouts/default/index.tsx

This file was deleted.

6 changes: 3 additions & 3 deletions src/layouts/default/useLayoutContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ export interface LayoutContextProps {
isMobile: Ref<boolean>;
}

const layoutContextInjectKey: InjectionKey<LayoutContextProps> = Symbol();
const key: InjectionKey<LayoutContextProps> = Symbol();

export function createLayoutContext(context: LayoutContextProps) {
return createContext<LayoutContextProps>(context, layoutContextInjectKey);
return createContext<LayoutContextProps>(context, key);
}

export function useLayoutContext() {
return useContext<LayoutContextProps>(layoutContextInjectKey);
return useContext<LayoutContextProps>(key);
}

0 comments on commit f81c401

Please sign in to comment.