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

Marker.color types are invalid #87

Open
jamesatjaminit opened this issue Jun 2, 2023 · 0 comments
Open

Marker.color types are invalid #87

jamesatjaminit opened this issue Jun 2, 2023 · 0 comments

Comments

@jamesatjaminit
Copy link
Contributor

jamesatjaminit commented Jun 2, 2023

When creating a Marker, the typescript reports the color attribute to be a number. However, it should actually support strings as per mapbox documentation.

From what I gather, you aren't creating typescript types yourself, so it's likely as a result of the randomColour() function. Maybe this function could be changed to produce a random hex code (therefore returning a string) and then the types would be correct?

Example:

<Marker lng={long} {lat} label={name} color="#414288" />

Error:

Type 'string' is not assignable to type 'number'.ts(2322)
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

1 participant