Skip to content

Commit 65a1fd9

Browse files
authored
update-links-n-context-doc (#531)
* update-links-n-context-doc * fix indent
1 parent 68616a3 commit 65a1fd9

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

src/stories/docs/Introduction.stories.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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

src/stories/hooks/use-transform-context.stories.mdx

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff 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+
79
Use the direct access to the `Zoom-Pan-Pinch instance` and create your own hooks
810
and 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
```

0 commit comments

Comments
 (0)