File tree Expand file tree Collapse file tree 2 files changed +27
-4
lines changed Expand file tree Collapse file tree 2 files changed +27
-4
lines changed Original file line number Diff line number Diff line change @@ -43,8 +43,8 @@ import { Meta } from "@storybook/addon-docs/blocks";
4343> Super fast and light react npm package for zooming, panning and pinching html
4444> elements in easy way
4545
46- - [ Demo] ( https://prc5 .github.io/react-zoom-pan-pinch/?path=/story/examples-big-image--big-image )
47- - [ Docs] ( https://prc5 .github.io/react-zoom-pan-pinch/?path=/story/docs-props--page )
46+ - [ Demo] ( https://bettertyped .github.io/react-zoom-pan-pinch/?path=/story/examples-big-image--big-image )
47+ - [ Docs] ( https://bettertyped .github.io/react-zoom-pan-pinch/?path=/story/docs-props--page )
4848
4949## Key Features
5050
Original file line number Diff line number Diff line change @@ -4,12 +4,35 @@ import { Meta } from "@storybook/addon-docs/blocks";
44
55# useTransformContext
66
7+ Must be used within the ` TransformWrapper ` .
8+
79Use the direct access to the ` Zoom-Pan-Pinch instance ` and create your own hooks
810and logic with ease.
911
12+ An example is accessing the current positions and scale of the ` instance ` through ` context.transformState ` .
13+
1014### Example
1115
1216``` tsx
13- // Simple access to the context instance
14- const context = useTransformContext ();
17+ const App = () => {
18+
19+ const MyComponent = () => {
20+ // Simple access to the context
21+ const context = useTransformContext ();
22+ return (... )
23+ };
24+
25+
26+ return (
27+ <TransformWrapper
28+ { ... props }
29+ >
30+ <TransformComponent >
31+ <MyComponent />
32+ </TransformComponent >
33+ </TransformWrapper >
34+ );
35+ };
36+
37+
1538```
You can’t perform that action at this time.
0 commit comments