Skip to content
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

TitleBar platform type conflicts with process.platform type #77

Open
mgs95 opened this issue Oct 14, 2020 · 1 comment
Open

TitleBar platform type conflicts with process.platform type #77

mgs95 opened this issue Oct 14, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@mgs95
Copy link

mgs95 commented Oct 14, 2020

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:

  1. Use typescript
  2. Use TitleBar component with platform property set as process.platform.
  3. See typescript error

Expected behavior
process.platform type accepted by the property.

Screenshots
If applicable, add screenshots to help explain your problem.
image
image

Desktop (please complete the following information):

  • OS: ubuntu
  • Version: v2.1.4
@Cristian006
Copy link
Owner

@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 👍

@Cristian006 Cristian006 added the enhancement New feature or request label Nov 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants