Skip to content

Commit

Permalink
Use Of type in useOf argument
Browse files Browse the repository at this point in the history
  • Loading branch information
tmeasday committed Mar 7, 2023
1 parent fa83aa2 commit dc44ac0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions code/ui/blocks/src/blocks/Story.tsx
Expand Up @@ -115,6 +115,7 @@ export const getStoryId = (props: StoryProps, context: DocsContextProps): StoryI
Please refer to the migration guide: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#story-block'`);
}

console.log(props, 'of' in props);
if (meta) context.referenceMeta(meta, false);
const resolved = context.resolveOf(of || story || 'story', ['story']);
return resolved.story.id;
Expand Down
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 dc44ac0

Please sign in to comment.