question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing intellisense for variants

See original GitHub issue

Hey, I tried following your guides to set up variants for my Text component, but it TypeScript refuses to acknowledge the keys under text in MyTheme.

I noticed that Text gets the prop type StyledProps<'text', never> & TextProps Manually updating never to DripsyVariant<'text'> solves the issue, and gives me correct suggestions. When looking at the source for createThemeComponent, then it seems like that is also the intention: https://github.com/nandorojo/dripsy/blob/798c6819c01ce4203e585739235b37b7f5b7efe9/packages/core/src/css/create-themed-component.tsx#L20 https://github.com/nandorojo/dripsy/blob/798c6819c01ce4203e585739235b37b7f5b7efe9/packages/core/src/css/types.ts#L287-L290 Has it been built wrong?

I have dumped my files for a repro into a gist: https://gist.github.com/Jomik/faa0f1ca6c7f46ba179c3bdfb60b1d0c

Versions:

{
    "dripsy": "^3.2.1",
    "typescript": "~4.4.4"
}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:31 (23 by maintainers)

github_iconTop GitHub Comments

2reactions
nandorojocommented, Nov 13, 2021

3.5.3 should also fix this prop for components without a themeKey, such as View. Man, this was a tough one. all done though 🥳

1reaction
nandorojocommented, Nov 16, 2021

Hm weird, it’s working for me. Could you try reproducing on CodeSandbox maybe?

Do you also have @dripsy/gradient installed? If so, make sure to update that too.

Read more comments on GitHub >

github_iconTop Results From Across the Web

IntelliSense uses the short name from the variants file ... - GitHub
I have no idea where the discrepancy originates. As with other users, downgrading to 1.7.3 fixes the issue. 1.8.0 shows the same behavior...
Read more >
C++ IntelliSense gives errors with the variant header in clang ...
Use the attached test6.cpp file which is based on the g++ library 10.2 variant header. Bug: It gives squiggles, but clang compiles it...
Read more >
IntelliSense completion for types & extension methods
How to use IntelliSense completion for types and extension methods that you haven't imported yet with a `using` directive.
Read more >
Fixing Visual Studio Intellisense Errors - Rick Strahl's Web Log
I ran into a problem in one of my applications where Visual Studio was showing errors that were clearly not actual errors.
Read more >
Intellisense not automatically working VSCode - Stack Overflow
Opened via the vs code "recent" history. For dotnet core. I opened my project's *.csprog file, made no changes, and saved it via...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found