Skip to content

Commit

Permalink
Merge pull request #21442 from storybookjs/tom/export-useOf-type
Browse files Browse the repository at this point in the history
Use `Of` type in `useOf` argument
  • Loading branch information
JReinhold committed Mar 7, 2023
2 parents fa83aa2 + 68634fc commit cc5dad2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions code/ui/blocks/src/blocks/useOf.ts
@@ -1,6 +1,5 @@
import type {
DocsContextProps,
ModuleExport,
ResolvedModuleExportType,
ResolvedModuleExportFromType,
} from '@storybook/types';
Expand All @@ -16,7 +15,7 @@ export type Of = Parameters<DocsContextProps['resolveOf']>[0];
* if the resolved module is a component it will include the project annotations
*/
export const useOf = <TType extends ResolvedModuleExportType>(
moduleExportOrType: ModuleExport | TType,
moduleExportOrType: Of,
validTypes?: TType[]
): ResolvedModuleExportFromType<TType> => {
const context = useContext(DocsContext);
Expand Down

0 comments on commit cc5dad2

Please sign in to comment.