TitleBar platform type conflicts with process.platform type
mgs95 opened this issue · 1 comments
Describe the bug
TitleBar platform type is set as "darwin" | "linux" | "win32" | undefined
but process.platform type is NodeJS.Platform
and both are not compatible so casting is required:
Does not work:
<TitleBar
platform={process.platform}
> </TitleBar>
Work:
<TitleBar
platform={process.platform as "darwin" | "linux" | "win32" | undefined}
> </TitleBar>
I think that the type should be accepted and an error should occur if the platform is not supported.
To Reproduce
Steps to reproduce the behavior:
- Use typescript
- Use
TitleBar
component withplatform
property set asprocess.platform
. - See typescript error
Expected behavior
process.platform
type accepted by the property.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: ubuntu
- Version: v2.1.4
@mgs95 Thanks for pointing this out, I'll add that into the typings file for the next release but instead of throwing an error for an unsupported platform it will just default to win32
👍