nandorojo / dripsy

🍷 Responsive, unstyled UI primitives for React Native + Web.
https://dripsy.xyz
MIT License
1.99k stars 77 forks source link

Autocomplete not working with TypeScript 4.5+ #242

Closed nandorojo closed 1 year ago

nandorojo commented 1 year ago

Leaving a note to look into this later. If your autocomplete doesn't work, you can do this:

{
  "resolutions": {
    "typescript": "~4.4"
  }
}

Then run yarn --force.

If you're using the nightly typescript plugin on VSCode, then you might need to override the version VSCode uses. Generally, this is a good thing to do anyway: your IDE should match the version of your project's TypeScript.

You can add this file to your project to do that: .vscode/settings.json

{
 "typescript.tsdk": "node_modules/typescript/lib"
}

I think this issue is due to stricter types related to keyof when it comes to potential use of Symbol.

Has anyone else faced this problem with versions of TypeScript higher than 4.4?

chrisarts commented 1 year ago

Yes im using latest expo version and it upgrade my ts to 4.8.4 and autocomplete is weid, works on some cases and not on others

matifriaz commented 1 year ago

Yes, I’m using 4.8 and autocomplete is not working for spaces, colors etc etc. I tried look into but couldn’t find the issue. Btw is it because of the union type? That TS is just focusing on the string type and not showing the other options bcoz string is the parent type ever other value…. FYI: Autocomplete is working for variants

nandorojo commented 1 year ago

yeah it’s going to require spending some time on debugging to. i think it’s that TS 4.5+ is stricter on strings and let’s keyof be Symbol too.

wezter96 commented 1 year ago

Has anyone had any progress on this? I stumbled into the same issue now with 4.9.3.

Is the recommended solution to go with resolutions for TS? 🤔

nandorojo commented 1 year ago

yeah for now, i haven’t had time to look into this

matifriaz commented 1 year ago

Did we find any fix for this?

jaivinwylde commented 1 year ago

Same problem here too. I've run into keyof issues with Symbol on my projects and to fix it I just do Extract<keyof T, string>. Is that still the issue? You already do this in some places, are there just more places where you need this?

nandorojo commented 1 year ago

I’ve tried but haven’t been able to fix it yet. It’s very tricky. These versions work for now: https://github.com/nandorojo/dripsy/issues/260#issuecomment-1366189232

nandorojo commented 1 year ago

Moving to #276