Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc Blocks: Add title to Meta prop types #23370

Merged
merged 7 commits into from
Aug 29, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions code/ui/blocks/src/blocks/Meta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import type { BaseAnnotations, ModuleExports } from '@storybook/types';
import { Anchor } from './Anchor';
import { DocsContext } from './DocsContext';

type MetaProps = BaseAnnotations & { of?: ModuleExports };
type MetaProps = BaseAnnotations & { of?: ModuleExports; title?: string };

/**
* This component is used to declare component metadata in docs
* and gets transformed into a default export underneath the hood.
*/
export const Meta: FC<MetaProps> = ({ of }) => {
export const Meta: FC<MetaProps> = ({ of, title }) => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you need to destructure the title out of props here as it's never being used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MWhite-22 thank u for responding. I have updated this please can you consider this PR for merging so that i can get my first PR merged.

const context = useContext(DocsContext);
if (of) {
context.referenceMeta(of, true);
Expand Down