drawDB/src/context/TransformContext.jsx

17 lines
397 B
React
Raw Normal View History

2024-03-11 01:24:19 +08:00
import { createContext, useState } from "react";
export const TransformContext = createContext(null);
export default function TransformContextProvider({ children }) {
const [transform, setTransform] = useState({
zoom: 1,
pan: { x: 0, y: 0 },
});
return (
<TransformContext.Provider value={{ transform, setTransform }}>
{children}
</TransformContext.Provider>
);
}