Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

demonstrate the problems by removing my workarounds #252

Draft
wants to merge 1 commit into
base: issue-250-package-multi
Choose a base branch
from

Conversation

Jumpy-Squirrel
Copy link
Contributor

This branch contains an extra commit that removes two of my most ugly workarounds.

On the first one (addon.tsx), if you inspect value.addons in the debugger, it very much has a field "selected". But somehow the typescript compiler doesn't seem to understand this.

The second one is even more confusing (register.ts). The error message of npm run tsc is:

src/state/selectors/register.ts:60:40 - error TS2339: Property 'count' does not exist on type '{ readonly count: "c1" | "c2" | "c3" | "c4" | "c5" | "c6" | "c8" | "c10" | "c15" | "c20" | "c30" | "c40" | "c50" | "c100"; } | { readonly count: "c1" | "c2" | "c3" | "c4" | "c5" | "c6" | "c8" | "c10" | "c7" | "c9"; } | ... 28 more ... | {}'.
  Property 'count' does not exist on type '{ readonly size: "XS" | "S" | "M" | "L" | "XL" | "XXL" | "m3XL" | "m4XL" | "wXS" | "wS" | "wM" | "wL" | "wXL" | "wXXL" | "w3XL" | "w4XL"; }'.

huh? Property 'count' does not exist on type '{ readonly count: ...

Yeah, I know it does not exist on ALL possible types, but that's what the ?.count is for, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant