-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
Description
This issue was originally reported by @jwalton in #2133. Confirmed that issue exists in 7.13.0 and 7.14.1 (we are not using typescript in our project).
simple solution there, use a default export :-D
In latest build, this appears to be broken for a default export (although... I'm in a typescript project, so this might be a problem specific to linting .tsx files):
export default React.memo(function LabelControl(props: ControlProps) {
const control = props.control as OnDemandLabelControl;
return (
<ControlWrapper>
<Translate tagName="h2" message={control.title} />
</ControlWrapper>
);
});
triggers react/display-name, but:
function LabelControl(props: ControlProps) {
const control = props.control as OnDemandLabelControl;
return (
<ControlWrapper>
<Translate tagName="h2" message={control.title} />
</ControlWrapper>
);
}
export default React.memo(LabelControl);
does not.
Originally posted by @jwalton in #2133 (comment)
ljharb, jwalton, dwelle, ksweetie and mgonzalezbernal