New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React FunctionComponents and destructured params are incomprehensible #1288
Comments
Example repo: https://github.com/WilliamJns/typedoc-react-fc-sample |
I'm hitting this issue as well - is there not a way to hide |
Using interface Props {
foo: string
bar?: (event: MouseEvent) => void
}
/**
* Test component
*
* ```tsx
* <Test>
* ...
* </test>
* ```
* @category Component
* @param {object} __namedParameters Component properties
*/
const Test: FunctionComponent<Props> = ({
/**
* @hidden
*/
children,
/**
* @param {string} Foo - Foo description
*/
foo,
/**
* @param {function} [Bar] - Bar description
*/
bar,
}) => {
...
}
export default Test |
@rihardsgravis thanks, I will try it. But why do not receive property comments directly from |
So, mostly fixing this is pretty easy. Unfortunately it breaks this test: /**
* Destructuring function parameters.
*/
function drawText({text = '', location: [x, y] = [0, 0], bold = false}) { } Properly fixing this requires a new type model, |
Search terms
I'm using TypeDoc to document a Frontend project that was developed using ReactJS.
Unfortunately, TypeDoc cannot present the type of
ReactJS
component correctly in an understandable and clear form because react architecture uses object destructuring to use props object.Source:
In more complex components, this problem will be even more annoying. Here is another complex component sample
I tried to use
@param
, but there was no difference in the generated document.If you have an idea to solve this problem, please let me know.
Steps to reproduce the bug
I've created a sample project that you can use
npm i
&npm run build:docs
to seethe above example result.
https://github.com/WilliamJns/typedoc-react-fc-sample
Environment
The text was updated successfully, but these errors were encountered: