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> |
|
); |
|
}; |
In #98656 we noticed that functions that are defined as
const myVar = (params) => {...}are reported asmyVar.$1is missing comments.Functions that do not require any params (
const myVar = () => {...}) don't show such errors. We might need to fix ourscripts/build_api_docspiece 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.FCdefinitions like the one below:kibana/src/plugins/usage_collection/public/components/track_application_view/track_application_view.tsx
Lines 23 to 32 in 7eb733f