Skip to content

[APIDocs] const + arrow functions result in uncommented function parameters #98744

@afharo

Description

@afharo

In #98656 we noticed that functions that are defined as const myVar = (params) => {...} are reported as myVar.$1 is missing comments.

Functions that do not require any params (const myVar = () => {...}) don't show such errors. We might need to fix our scripts/build_api_docs piece of logic to cover this use case.

Why using const + arrow function vs. function? Because it helps with the typing of the function. An example is React.FC definitions like the one below:

export const TrackApplicationView: FC<TrackApplicationViewProps> = (props) => {
return (
<ApplicationUsageContext.Consumer>
{(value) => {
const propsWithTracker = { ...props, applicationUsageTracker: value };
return <TrackApplicationViewComponent {...propsWithTracker} />;
}}
</ApplicationUsageContext.Consumer>
);
};

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions