Skip to content

Typing issue (possibly to do with strict null types) #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jamiewinder opened this issue Nov 21, 2019 · 3 comments
Closed

Typing issue (possibly to do with strict null types) #52

jamiewinder opened this issue Nov 21, 2019 · 3 comments

Comments

@jamiewinder
Copy link
Contributor

When I build my TypeScript project which uses this library, I get several typing errors in the styles.d.ts file. This appears to be due to the properties of ReactDiffViewerStyles being optional properties, but the type of [key: string] being string, not string | undefined.

@praneshr
Copy link
Owner

Hi @jamiewinder, can you share your tsconfig?

@dodev
Copy link

dodev commented Nov 24, 2019

I'm experiencing the same problem. I have the strictNullChecks flag set to true.

I see there was an issue regarding this problem - #17 and @praneshr recommended turning off the strict null checks. But there are cases where doing so is very time consuming, i.e. when big chunks of your code depend on that compiler flag.

@praneshr would you please consider @jamiewinder solution to the problem? Then your component will compile fine in projects where strictNullChecks is set to true or false.

@praneshr
Copy link
Owner

Fixed in v2.0.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants