Skip to content

Typescript type error for control.values #6

@sh15h4nk

Description

@sh15h4nk

Hey there, I have used your npm package in my React typescript app, and I couldn't able to install the types package, but as you mentioned in the previous issue they will be included in the package itself. But when I use your example code, it raises some type value assignment error.

Type '{ banner: boolean; control: { values: number[]; onClick: (point: any) => void; onRemove: (point: any) => void; }; }' is not assignable to type 'PointMode'.
  The types of 'control.values' are incompatible between these types.
    Type 'number[]' is not assignable to type 'LatLngTuple[]'.
      Type 'number' is not assignable to type 'LatLngTuple'.  TS2322

    141 |     banner: false
    142 |   };
  > 143 |   return <LocationPicker pointMode={pointMode} circleMode={circleMode} />;
        |                          ^
    144 | };

But when I remove the pointMode prop from the LocationPicker everything works fine, I want to update my fields on drag of the picker.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions