mohux / react-brackets

Reusable and customizable react brackets component, you can use it to build components such as single elimination, or double elimination brackets
105 stars 47 forks source link

[Bug] when set mobileBreakpoint to 0 #21

Open MahmoudTarekAli opened 1 year ago

MahmoudTarekAli commented 1 year ago

Warning: Encountered two children with the same key, `1`. 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 div (created by styled.div) in styled.div (created by SingleElimination) in div (created by styled.div) in styled.div (created by SingleElimination) in div (created by ReactSwipableView) in div (created by ReactSwipableView) in div (created by ReactSwipableView) in ReactSwipableView (created by SingleElimination) in div (created by styled.div) in styled.div (created by SingleElimination) in SingleElimination (at wining-bracket.tsx:29) in WiningBracket (at double-elimination/index.tsx:112) in div (at double-elimination/index.tsx:111) in DoubleElimination (at App.tsx:17) in div (at App.tsx:8) in App (at src/index.tsx:7)

MahmoudTarekAli commented 1 year ago

This Issue was only on your example I tried the library on a different project and it was just working fine. Thank you for making this lib

MahmoudTarekAli commented 1 year ago

It was because array.fill create two seed with the same id


    title: 'Round 2',
    seeds: [...new Array(2)].fill({
      id: 12,
      teams: [
        {id: 33, name: 'The Leons', score: 2},
        {id: 44, name: 'Kitties', score: 6},
      ],
    }),
  },```