Abstract TransformContext

This commit is contained in:
1ilit
2024-03-10 19:24:19 +02:00
parent dd4ec59e56
commit 23bc6278a2
5 changed files with 150 additions and 131 deletions
+16
View File
@@ -0,0 +1,16 @@
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>
);
}