Logs: cleaned up warnings because of duplicate keys in context menu
Summary: In dev build there were tons of warnings on opening table context menu, because some items had same keys. This diff fixes that by differentiating item keys. Reviewed By: mweststrate Differential Revision: D33277520 fbshipit-source-id: aca2fa2f1163a2b6782be0ca4c5baebdecc5acd5
This commit is contained in:
committed by
Facebook GitHub Bot
parent
dd4d7bbe7f
commit
d48fbd8e50
@@ -111,7 +111,7 @@ export function tableContextMenuFactory<T>(
|
||||
</Item>
|
||||
{lib.isFB && (
|
||||
<Item
|
||||
key="createPaste"
|
||||
key="createPasteJSON"
|
||||
disabled={!hasSelection}
|
||||
onClick={() => {
|
||||
const items = getSelectedItems(datasource, selection);
|
||||
@@ -131,7 +131,7 @@ export function tableContextMenuFactory<T>(
|
||||
disabled={!hasSelection}>
|
||||
{visibleColumns.map((column, idx) => (
|
||||
<Item
|
||||
key={column.key ?? idx}
|
||||
key={'copy cell' + (column.key ?? idx)}
|
||||
onClick={() => {
|
||||
const items = getSelectedItems(datasource, selection);
|
||||
if (items.length) {
|
||||
@@ -147,7 +147,7 @@ export function tableContextMenuFactory<T>(
|
||||
<Menu.Divider />
|
||||
<SubMenu title="Visible columns" key="visible columns">
|
||||
{columns.map((column, idx) => (
|
||||
<Menu.Item key={column.key ?? idx}>
|
||||
<Menu.Item key={'visible column ' + (column.key ?? idx)}>
|
||||
<Checkbox
|
||||
checked={column.visible}
|
||||
onClick={(e) => {
|
||||
|
||||
Reference in New Issue
Block a user