0

I have tried to document props on vscode with JSDoc multiple times on my custom styled component, but I just can't make it show up in any way.

what shows up for me

I have tried with the following syntax:

/**
 * @param {boolean} testprop - 20px
 */
export const Text``

export interface TextProps {
  /* 20px */ t2?: boolean
}
export const Text<TextProps>``

None of those 2 works so far.

  • Is there any way to make it show up when you hover the prop?
  • What's best practice for this?
Besto
  • 388
  • 1
  • 13
  • Should the documentation go *with* the component that it describes? I.E. the second `Text` component with a `t2` prop? – Drew Reese Jan 25 '22 at 06:56
  • I don't know what you mean. I want it when you hover `t2` on ` – Besto Jan 30 '22 at 17:54
  • I was referring to the fact that you've documented the `export const Text\`\`` component but not the `export const Text\`\`` component. But I think I see what you're getting at now. You wanted to jsdoc the interface. – Drew Reese Jan 31 '22 at 00:38

1 Answers1

0

This syntax worked for me:

export interface TextProps {
  /** 20px */ t2?: boolean
}
export const Text<TextProps>``

Note that the comment starts with 2 asterisks (/**)

Now I can hover t2 and get the comment I set before.

enter image description here enter image description here

Besto
  • 388
  • 1
  • 13