react-bootstrap-table/react-bootstrap-table2

Two columns have same dataField will cause the same key warning of React

Open

#601 opened on Oct 10, 2018

View on GitHub
 (14 comments) (12 reactions) (0 assignees)JavaScript (1,249 stars) (415 forks)batch import
enhancementgood first issue

Description

In some case, we need to add two columns which bound to same dataField, but show different test, for example, a filed of Date will be shown in two columns, one will show and edit for day part, and the other will show and edit for time part. in this case, we will get the below warning:

Warning: Encountered two children with the same key, time. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and

could change in a future version. in tr (created by Header) in thead (created by Header) in Header (created by BootstrapTable) in table (created by BootstrapTable) in div (created by BootstrapTable) in BootstrapTable (created by Context.Consumer) in SelectionProvider (created by Context.Consumer) in SortProvider (created by Context.Consumer) in CellEditProvider (created by Context.Consumer) in DataProvider (created by Table) in Table (created by Table) in Table (created by AppDefaultTable) in div (created by AppDefaultTable) in AppDefaultTable (created by Table) in Table (created by TableWithToolbar) in TableWithToolbar (created by Page) in div (created by Row) in div (created by Row) in div (created by Row) in article (created by Row) in div (created by Row) in Row (created by Page) in section (created by PageLayout) in PageLayout (created by Page) in Page (created by Connect(Page)) in Connect(Page) (created by Route) in Route (created by App) in Switch (created by App) in Router (created by BrowserRouter) in BrowserRouter (created by App) in Provider (created by App) in App

Contributor guide