Skip to content

Marker.color types are invalid #87

@jamesatjaminit

Description

@jamesatjaminit

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions