react-checkbox-tree icon indicating copy to clipboard operation
react-checkbox-tree copied to clipboard

Unique key props

Open vikassingh1994 opened this issue 4 years ago • 4 comments

index.js:1 Warning: Each child in a list should have a unique "key" prop.

Check the render method of a. See https://fb.me/react-warning-keys for more information. in Gi (created by a) in a (created by s) in ol (created by s) in div (created by s) in s (at Stores.js:146) in div (at Stores.js:145) in div (at Stores.js:132) in Stores (created by WithStyles(Stores)) in WithStyles(Stores) (at PosLeftDrawer.js:679) in div (created by Transition) in div (created by Transition) in div (created by Transition) in Transition (created by ForwardRef(Collapse)) in ForwardRef(Collapse) (created by WithStyles(ForwardRef(Collapse))) in WithStyles(ForwardRef(Collapse)) (at PosLeftDrawer.js:663) in ul (created by ForwardRef(List)) in ForwardRef(List) (created by WithStyles(ForwardRef(List))) in WithStyles(ForwardRef(List)) (at PosLeftDrawer.js:593) in div (created by ForwardRef(Paper)) in ForwardRef(Paper) (created by WithStyles(ForwardRef(Paper))) in WithStyles(ForwardRef(Paper)) (created by Transition) in Transition (created by ForwardRef(Slide)) in ForwardRef(Slide) (created by ForwardRef(Drawer)) in div (created by ForwardRef(Drawer)) in ForwardRef(Drawer) (created by WithStyles(ForwardRef(Drawer))) in WithStyles(ForwardRef(Drawer)) (at PosLeftDrawer.js:578) in PosLeftDrawer (created by WithStyles(PosLeftDrawer)) in WithStyles(PosLeftDrawer) (at Layout.js:406) in div (at Layout.js:393) in Route (created by ProtectedRoute) in ProtectedRoute (created by ProtectedRoute$1) in ProtectedRoute$1 (at Layout.js:383) in Layout (created by WithStyles(Layout)) in WithStyles(Layout) (created by ConnectFunction) in ConnectFunction (at App.js:29) in Route (at App.js:26) in Switch (at App.js:24) in Router (created by BrowserRouter) in BrowserRouter (at App.js:22) in Main (at App.js:52) in Route (at App.js:52) in Switch (at App.js:51) in Router (created by BrowserRouter) in BrowserRouter (at App.js:50) in CssBaseline (at App.js:49) in ThemeProvider (at App.js:48) in Authentication in Authentication (created by AuthenticationProvider) in AuthenticationProvider (at App.js:47) in App (at src/index.js:33) in Provider (at src/index.js:32)

vikassingh1994 avatar Jan 08 '21 05:01 vikassingh1994

As specified in the README, all nodes must have a unique key value. This is due to supporting key values in the checked and expanded properties as well as for performance reasons.

jakezatecky avatar Jan 20 '21 00:01 jakezatecky

[{"value":"All Registers","label":"All Registers","children":[{"value":"0046","label":"POS-46 Optical"},{"value":"0075","label":"POS-75 Lane 5"}]}] Is something Wrong with this DATA? @jakezatecky

vikassingh1994 avatar Feb 02 '21 10:02 vikassingh1994

Nothing seems wrong with those values, but I suspect nodes violating the unique value constraint exist at some point. If you can recreate the issue in a small demo environment, like in CodePen, then I can look at the issue further.

jakezatecky avatar Feb 06 '21 23:02 jakezatecky

This started happening for us when we updated to 1.7.2 from 1.6. We had duplicate nodes under different "categories", which worked fine before. We just removed the duplicate nodes.

elake2018 avatar Sep 24 '21 20:09 elake2018