react-docgen
react-docgen copied to clipboard
DocGen not recognizing decomposed function parameters
Within one of my components, I wrote a function that would fetch user data given a username passed as a prop. The function is referenced through lifecycle in multiple places and is documented as below.
/**
* @param {Object} prop - component props
* @param {string} prop.user - user whose profile should be fetched
*/
fetch = ({ user }) => {
// ...
}
The resulting doc does not reference anything from the above and simply puts name: '{ user }' as the parameter. I thought I would be able to use JSDoc syntax.
Do you have a suggestion for how we should represent destructured parameters in the JSON output?
It could be very similar to the FlowType output, w/ signature etc.