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 3c2bf11
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 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 @@ -78,6 +78,11 @@ export function Default() {
lngLat.lat,
];
// eslint-disable-next-line no-param-reassign
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 +125,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 3c2bf11

Please sign in to comment.