Type check error with Typescript 4.4 exactOptionalPropertyTypes
See original GitHub issueDescribe the bug Applying getTooltipProps on a div gives an error with Typescript 4.4 when the (recommended) new option exactOptionalPropertyTypes is set.
To Reproduce Steps to reproduce the behavior:
- Upgrade Typescript to 4.4.
- Add:
"exactOptionalPropertyTypes": true,
to tsconfig.json - Style a
div
with{...getTooltipProps(...)}
Expected behavior No type check error
Screenshots
Desktop (please complete the following information):
- Windows 10
- Newest chrome
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Documentation - TypeScript 4.4
TypeScript recognized the typeof arg === "string" check, which it considered a type guard, and knew that arg was a string inside the...
Read more >Support TypeScript 4.4 exactOptionalPropertyTypes #1919
Theme UI needs some type improvements to work correctly with this setting enabled. ... I believe the issue may be upstream in @types/styled-system...
Read more >TypeScript 4.4 — What's New? - JavaScript in Plain English
Exact Optional Property Types This means that in previous versions of TypeScript you were able to explicitly create an object where the...
Read more >TypeScript 4.4: The Good, The Bad and The Not So Bad
As a result, TS gave an error when you used type-specific methods and properties, still thinking that arg 's type is string |...
Read more >What's new in TypeScript v4.4? - DEV Community
If you have a CustomError, you can create a class and make them extend with Error. 3. Exact Optional Property Types. This feature...
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
@mohsinulhaq: Sorry only saw this now 😃 Yes, the error went away. I am using 4.4.2 now.
@gunters63 great, thanks!