Typescript definition missing important properties or has properties that should be optional.
See original GitHub issueCauses huge walls of (invalid) errors in our codebase after upgrading to 2.4.0. I’ve taken to rm’ing index.d.ts
for now 😃
The issues are:
Router
has nohistory
prop.RouterArgs.matches
should be optional.RouterArgs.url
should be optional.RouterArgs.path
should be present.
I think that’s all, but don’t have time atm to try to fix or dig deeper so there may be others.
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
How to Deal with Optional Things and "Undefined" in TypeScript
First, if you don't tell TypeScript that a property is optional, it will expect it to be set. Adding ? to the property...
Read more >When to use typescript optional "?" parameter vs explicit ...
Typescript “?” operator means that parameter is optional, it's not necessary to pass it in component/function.
Read more >How can I make one property non-optional in a typescript type?
I like this approach because you don't need to define a new Generic, but you will still benefit from being able to freely...
Read more >Documentation - Advanced Types - TypeScript
Optional parameters and properties Type 'undefined' is not assignable to type 'number'.Type 'undefined' is not assignable to type 'number'.
Read more >optional vs. undefined - TkDodo's blog
Most people I know prefer the first way because it's shorter, and you don't need to invent a name like key - and...
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 Free
Top 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
Nice! Will try and get that cleaned up at the end of the week.
It would be nice to have the type definitions back. I can try and add them.