Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

166
Views
share more information on var/object properties when on hover for the developer (JS/REACT/TS)

I have a a complex theme object, everything is typed in typescript.

I have an object, lets say:

that's much larger and complex then this:

const themeObj = { 
  colors: {
    red1: "#asd123",
    //... etc
  },
  sizes: {
    size1: "10px",
    size2: "11px",
    size3: "14px",
  }
}

the ts works fine, in which I can use the theme object and it will show me on hover:

fontSize: theme.sizes.size3; //can auto complete, and shows me all sizes

except the main issue I have with this is it only show that the size (i.e. size3) is a string

like so: (property) size3: string

It would be extremely valuable if I could add more information to this hover, such as the actual value of the string (14px). I could use this sort of detailed feature in multiple places. I have a very difficult time googling this as well.

Is this IDE dependant? I use vscode.

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Since you say you're using TypeScript, you can simply change the themeObj to be typed as const, and then its values won't be widened to string.

enter image description here

about 4 years ago · Juan Pablo Isaza Report

0

try this one: fontSize: {theme.sizes.size3};

it may work

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!