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)
When creating a Marker, the typescript reports the
colorattribute 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:
Error: