0

I have a function which is a React component. The element it creates has position:absolute; In order for this property to work in a predictable way the parent element should be positioned with position: relatieve;. I would like to let future users of this component to know about this constraint. Is there a JSDoc tag for such a purpose? How would you let users of this component know about this important constraint?

Ben Carp
  • 24,214
  • 9
  • 60
  • 72

1 Answers1

1

You need to highlight that your component has a run-time dependency on a particular external state. There is no specific jsdoc tag for this, you'd need to document it in the description.

In jsdoc2md you can declare any arbitrary tag, if that helps - you could invent your own tag to document it.

Custom tag example:

/**
 * This function has a wonderful custom tag
 * @createdIn Nigeria
 */
function customTaggedFunction () {}

Produces this output:

customTaggedFunction()

This function has a wonderful custom tag

Kind: global function
Createdin: Nigeria

Lloyd
  • 8,204
  • 2
  • 38
  • 53