Skip to content

Commit 59d263a

Browse files
committed
Fix documentation
1 parent 55ce860 commit 59d263a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/docs/Picture.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ A Picture renders a previously recorded list of drawing operations on the canvas
1616
```tsx twoslash
1717
import React, { useMemo } from "react";
1818
import {
19-
usePicture,
19+
createPicture,
2020
Canvas,
2121
Picture,
2222
Skia,
@@ -25,7 +25,7 @@ import {
2525

2626
export const PictureExample = () => {
2727
// Create picture
28-
const picture = usePicture(
28+
const picture = useMemo(() => createPicture(
2929
{ x: 0, y: 0, width: 100, height: 100 },
3030
(canvas) => {
3131
const paint = Skia.Paint();
@@ -36,7 +36,7 @@ export const PictureExample = () => {
3636
circlePaint.setColor(Skia.Color("orange"));
3737
canvas.drawCircle(50, 50, 50, circlePaint);
3838
}
39-
);
39+
), []);
4040

4141
// Serialize the picture
4242
const serialized = useMemo(() => picture.serialize(), [picture]);

0 commit comments

Comments
 (0)