Skip to content

[Bug] Typescript error: Layer requires an id property #1908

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
fknop opened this issue Jul 3, 2022 · 2 comments
Closed

[Bug] Typescript error: Layer requires an id property #1908

fknop opened this issue Jul 3, 2022 · 2 comments
Labels

Comments

@fknop
Copy link

fknop commented Jul 3, 2022

Description

When using TypeScript, TS complains that Layer requires an id property, even though an auto-generated one is created for us here. I've provided a codesandbox with the issue

Expected Behavior

Typescript doesn't complain about a missing id

I believe that to Omit the id from unions, we need to use something like this microsoft/TypeScript#39556 (comment)

Steps to Reproduce

https://codesandbox.io/s/smoosh-microservice-pdf9f8?file=/src/App.tsx

image

Environment

  • Framework version: v7
  • Map library: mapbox-gl
  • Browser: Any
  • OS: Any

Logs

No response

@fknop fknop added the bug label Jul 3, 2022
@fknop
Copy link
Author

fknop commented Jul 3, 2022

This seems to be related to strictNullChecks

@Pessimistress
Copy link
Collaborator

Published 7.0.17

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

No branches or pull requests

2 participants