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

[Bug] Discrepancies in types defined on component level vs exported prop interface #2140

Open
shirshendubhowmick opened this issue Mar 14, 2023 · 0 comments
Labels

Comments

@shirshendubhowmick
Copy link

shirshendubhowmick commented Mar 14, 2023

Description

The MapProps interface doesn't match with the props defined in component level.

While doing some thing like

<Map fog={props.fog} />

Where props: MapProps

Getting error like

image

This is not just limited to the fog but there couple of other props with same issue.

And doing something like this

<Map {...props} />

where props: MapProps, results in bunch of TS errors.

Looks like the cause for this is how the types are defined:
On the component level the fog props is defined as:

image

On MapProps interface it is defined as:

image

Expected Behavior

Prop types should be consistent across the exported MapProps interface and the component

Steps to Reproduce

Step to reproduce is explained in detail in the the description section

Environment

  • Framework version: react-map-gl: 7.0.21
  • Map library: mapbox-gl: 2.13.0
  • Browser: N/A
  • OS: MacOS

Logs

No response

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

1 participant