react-tournament-bracket
react-tournament-bracket copied to clipboard
Trouble with new version of TS
new flag in tsconfig need for new version of TS
https://github.com/Microsoft/TypeScript/issues/25260#issuecomment-400600877
@baomastr is this flag supposed to be set in the dependencies, or in the project including them? the comment says...
Fixing the packages by hand is senseless.
@moodysalem the flag is supposed to be in tsconfig.json files for dev and prod in order to fix the errors with new version of TS like this:
Type 'keyof T' does not satisfy the constraint 'string'.
Type 'string | number | symbol' is not assignable to type 'string'.
Type 'number' is not assignable to type 'string'.
fixing TS package version by hand can also help but it is not right solution if you want to use new version of TS.
here is the link to changelist of TS : https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#keyof-now-includes-string-number-and-symbol-keys
and line in code, that causes error in new version is: https://github.com/moodysalem/react-tournament-bracket/blob/436b4ab75da8ca047a00c14a72db95b60e3a703a/src/components/BracketGenerator.tsx#L65
you can also see last comments about that trick http://ideasintosoftware.com/typescript-advanced-tricks/
You can just remove the export type Omit // ...
line now as normal TS has this type built-in.
You'll need to ignore the 2nd error about {}
not being part of the types.