Files
grungnet/src/contexts/MapInteractionContext.js
Mitchell McCaffrey b0c1dcf9dd Changed map drag position to use a ref value to avoid re-renders
Added a useMapBrush helper
2020-05-25 15:07:12 +10:00

16 lines
386 B
JavaScript

import React from "react";
const MapInteractionContext = React.createContext({
stageScale: 1,
stageWidth: 1,
stageHeight: 1,
stageDragState: "none",
setPreventMapInteraction: () => {},
mapWidth: 1,
mapHeight: 1,
mapDragPositionRef: { current: undefined },
});
export const MapInteractionProvider = MapInteractionContext.Provider;
export default MapInteractionContext;