I want to write JSDoc for some React component:
/**
* Some Component
* @param {Object} props - props of the component
* @param {boolean} [props.active=false] - active
* @param {string} props.text - text
* ...
* @returns {React.ReactElement} Some Component
*/
How can I correctly add property named 'aria-label'
in JSDoc?
I can't find the necessary solution in the Net.
I want to write JSDoc for some React component:
/**
* Some Component
* @param {Object} props - props of the component
* @param {boolean} [props.active=false] - active
* @param {string} props.text - text
* ...
* @returns {React.ReactElement} Some Component
*/
How can I correctly add property named 'aria-label'
in JSDoc?
I can't find the necessary solution in the Net.
Share Improve this question asked Nov 28, 2024 at 10:09 Lazy_CatLazy_Cat 215 bronze badges 3 |1 Answer
Reset to default 0@param {string} props['aria-label'] - your description
or in case it is not a part of props object:
@param {string} ['aria-label'] - your description
* @param {string} props.aria-label - an alternative label
? – evolutionxbox Commented Nov 28, 2024 at 10:51