[TS] From @types/react 16.3.9 React.CSSProperties is strongly typed
See original GitHub issueFrom 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:
- Created 5 years ago
- Reactions:2
- Comments:5 (5 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Module augmentation/casting definitely shouldn’t be required for this. This is a bug in either
@types/jss
ormaterial-ui
’s typings. Looking into it.I’ve opened a PR: #11007.