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.

typescript defs missing `id` attribute for Box

See original GitHub issue

Trying to do:

      <Box
        key={marker.points}
        display="inline-block"
        id={marker.label}
        width={`${width}%`}
        bg={filled ? '#959da5' : ''}
      >
        <div style={dotStyle} />
      </Box

And it is complaining about id:

Type '{ children: Element; key: number; display: string; id: string; width: string; bg: string; }' is not assignable to type 'IntrinsicAttributes & BoxProps & { children?: ReactNode; }'.
  Property 'id' does not exist on type 'IntrinsicAttributes & BoxProps & { children?: ReactNode; }'.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
T-Hugscommented, Sep 16, 2019

There is an Omit<T, K> utility type, which could be used for (3). https://www.typescriptlang.org/docs/handbook/utility-types.html#omittk

0reactions
toddselfcommented, Sep 25, 2019

Thanks y’all!

Read more comments on GitHub >

github_iconTop Results From Across the Web

typescript defs missing `id` attribute for Box · Issue #540
My only concern with this approach is if there are any props which explicitly don't want to expose to pass along to the...
Read more >
The property 'value' does not exist on value of type ...
Based on Tomasz Nurkiewiczs answer, the "problem" is that typescript is typesafe. :) So the document.getElementById() returns the type HTMLElement which ...
Read more >
The starting point for learning TypeScript
Find TypeScript starter projects: from Angular to React or Node.js and CLIs.
Read more >
typescript-cheatsheet - GitHub Pages
A set of TypeScript related notes used for quick reference. The cheatsheet contains references to types, classes, decorators, and many other TypeScript ......
Read more >
Useful Patterns by Use Case - React TypeScript Cheatsheets
// Note the <T extends unknown> before the function definition. // You can't use just `<T>` as it will confuse the TSX parser...
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