react-docgen icon indicating copy to clipboard operation
react-docgen copied to clipboard

DocGen not recognizing decomposed function parameters

Open rkichenama opened this issue 8 years ago • 2 comments

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.

rkichenama avatar Dec 17 '17 04:12 rkichenama

Do you have a suggestion for how we should represent destructured parameters in the JSON output?

fkling avatar Jan 23 '18 00:01 fkling

It could be very similar to the FlowType output, w/ signature etc.

nemoDreamer avatar May 18 '18 14:05 nemoDreamer