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.

Type check error with Typescript 4.4 exactOptionalPropertyTypes

See original GitHub issue

Describe 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 image

Desktop (please complete the following information):

  • Windows 10
  • Newest chrome

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
gunters63commented, Oct 5, 2022

@mohsinulhaq: Sorry only saw this now 😃 Yes, the error went away. I am using 4.4.2 now.

0reactions
mohsinulhaqcommented, Oct 5, 2022

@gunters63 great, thanks!

Read more comments on GitHub >

github_iconTop 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 >

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