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.

[TS] From @types/react 16.3.9 React.CSSProperties is strongly typed

See original GitHub issue

From types/react 16.3.9 react now uses csstypes as a package for CSSProperties, which is strongly typed This means that types for themes that used to rely on the fallback [k: string]: any for stuff such as “&:hover” gives now errors.

For those cases it should use something like

type ExtendedCSSProperties = React.CSSProperties & {
  [k: string]: any
}

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
pelotomcommented, Apr 12, 2018

Module augmentation/casting definitely shouldn’t be required for this. This is a bug in either @types/jss or material-ui’s typings. Looking into it.

0reactions
pelotomcommented, Apr 12, 2018

I’ve opened a PR: #11007.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[TS] From @types/react 16.3.9 React.CSSProperties ... - GitHub
From types/react 16.3.9 react now uses csstypes as a package for CSSProperties, which is strongly typed. This means that types for themes ...
Read more >
types/react/index.d.ts - UNPKG
1, // Type definitions for React 16.9. 2, // Project: http://facebook.github.io/react/. 3, // Definitions by: Asana <https://asana.com>.
Read more >
Build strongly typed polymorphic components with React and ...
Learn how to build strongly typed polymorphic React components with TypeScript, using familiar Chakra UI and MUI component props as guides.
Read more >
Type for style attribute passed to function - Stack Overflow
The type is React.CSSProperties . You can find this in VSCode by writing <div style={{}}> and pressing F12 when having your cursor in...
Read more >
Static Type Checking - React
Flow is a static type checker for your JavaScript code. It is developed at Facebook and is often used with React. It lets...
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