-
Notifications
You must be signed in to change notification settings - Fork 798
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
[Frontend] Some console errors fixes on settings page #5080
Conversation
{...fieldToTextField(props)} | ||
{...otherProps} | ||
value={value ?? ''} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reason: value
can be null. But an input should not be initialized with null or undefined value, instead use an empty string. By so, React can properly track changes with the input.
value={field.value} | ||
value={field.value ?? ''} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reason: value
can be null. But an input should not be initialized with null or undefined value, instead use an empty string. By so, React can properly track changes with the input.
{...fieldToSelect(props)} | ||
{...otherProps} | ||
value={value ?? ''} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reason: value
can be null. But an input should not be initialized with null or undefined value, instead use an empty string. By so, React can properly track changes with the input.
{...fieldToTextField(props)} | ||
{...otherProps} | ||
value={value ?? ''} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reason: value
can be null. But an input should not be initialized with null or undefined value, instead use an empty string. By so, React can properly track changes with the input.
settings.platform_cluster.instances_number | ||
`${settings.platform_cluster.instances_number}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reason: neutralLabel
accepts a string and not a number
return <div key="none" />; | ||
return <div key={i} />; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reason: always set a unique key to elements inside a loop. By so, React can correctly track each individual element.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you find something based on the data ? edge.node.id maybe ?
Using index is a last-resort strategy that can lead to issues (see https://robinpokorny.com/blog/index-as-a-key-is-an-anti-pattern/)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, this return is called when the data inside the map is undefined, so I can't really use any stuff linked to the data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok then
<ListItem style={{ paddingLeft: 0 }}> | ||
<ListItemIcon> | ||
<Skeleton | ||
animation="wave" | ||
variant="circular" | ||
width={30} | ||
height={30} | ||
/> | ||
</ListItemIcon> | ||
<ListItemText | ||
primary={ | ||
<div> | ||
{Object.values(dataColumns).map((value) => ( | ||
<div | ||
key={value.label} | ||
className={classes.bodyItem} | ||
style={{ width: value.width }} | ||
> | ||
<Skeleton | ||
animation="wave" | ||
variant="rectangular" | ||
width="90%" | ||
height={20} | ||
/> | ||
</div> | ||
))} | ||
</div> | ||
} | ||
<ListItemIcon> | ||
<Skeleton | ||
animation="wave" | ||
variant="circular" | ||
width={30} | ||
height={30} | ||
/> | ||
<ListItemIcon> | ||
<KeyboardArrowRightOutlined /> | ||
</ListItemIcon> | ||
</ListItem> | ||
</ListItemIcon> | ||
<ListItemText | ||
primary={ | ||
<div> | ||
{Object.values(dataColumns).map((value) => ( | ||
<div | ||
key={value.label} | ||
className={classes.bodyItem} | ||
style={{ width: value.width }} | ||
> | ||
<Skeleton | ||
animation="wave" | ||
variant="rectangular" | ||
width="90%" | ||
height={20} | ||
/> | ||
</div> | ||
))} | ||
</div> | ||
} | ||
/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just removed the imbricated ListItem
as it was not required.
Reason: li
inside li
was generated.
Proposed changes
Related issues
Checklist