Skip to content

Commit

Permalink
Fix typings for stories
Browse files Browse the repository at this point in the history
  • Loading branch information
tnagorra committed Nov 17, 2023
1 parent f4f5a24 commit f76b31a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion storybook/stories/WithDragInteraction.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const circleLayerOptions: Omit<CircleLayerSpecification, 'id' | 'source'> = {

export function Default() {
const [points, setPoints] = useState(
pointGeoJSON as GeoJSON.FeatureCollection<GeoJSON.Geometry>,
pointGeoJSON as GeoJSON.FeatureCollection<GeoJSON.Point>,
);

const handleDrag = useCallback(
Expand Down Expand Up @@ -77,6 +77,10 @@ export function Default() {
lngLat.lng,
lngLat.lat,
];
if (!safeOriginalPoint.properties) {
// eslint-disable-next-line no-param-reassign
safeOriginalPoint.properties = {};
}
// eslint-disable-next-line no-param-reassign
safeOriginalPoint.properties.transient = true;
},
Expand Down Expand Up @@ -120,6 +124,7 @@ export function Default() {
(item) => item.id === feature.id,
);
if (index !== -1) {
// eslint-disable-next-line no-param-reassign
safePoints.features[index].geometry.coordinates = [lngLat.lng, lngLat.lat];
}
});
Expand Down

0 comments on commit f76b31a

Please sign in to comment.