g-loot / react-tournament-brackets

React component library for displaying bracket leaderboards
https://sleepy-kare-d8538d.netlify.app/?path=/story/components-bracket--bracket
GNU Lesser General Public License v2.1
219 stars 69 forks source link

Types for data #29

Closed ted537 closed 2 years ago

ted537 commented 2 years ago

It would be really nice if the matches prop inputted to the single-elimination and double-elimination bracket react components was strongly typed. In terms of implementation, this should just be a matter of translating the examples into Typescript definitions.

ted537 commented 2 years ago

This would catch inconsistencies such as

state: 'SCHEDULED',

from the mock data.

'SCHEDULED' does not even appear in match-states.ts

ted537 commented 2 years ago

Nevermind, I didn't see the LeaderboardProps part. My bad.