[docs] Fix the types in the Shapes example (#1681)
This PR fixes some incorrect types in the example on the Shapes page of the docs. ### Change Type - [x] `documentation` — Changes to the documentation only[^2] [^1]: publishes a `patch` release, for devDependencies use `internal` [^2]: will not publish a new version ### Release Notes - Documentation: Fix some incorrect types on the Shapes page.
This commit is contained in:
parent
eb6aa9bbe4
commit
f07b915716
1 changed files with 4 additions and 4 deletions
|
@ -41,7 +41,7 @@ While tldraw's shapes themselves are simple JSON objects, we use `ShapeUtil` cla
|
|||
Let's create a `ShapeUtil` class for the shape.
|
||||
|
||||
```tsx
|
||||
import { ShapeUtil, HTMLContainer } from '@tldraw/tldraw'
|
||||
import { ShapeUtil, HTMLContainer, Box2d } from '@tldraw/tldraw'
|
||||
|
||||
class CardShapeUtil extends ShapeUtil<CardShape> {
|
||||
static type = 'card' as const
|
||||
|
@ -53,17 +53,17 @@ class CardShapeUtil extends ShapeUtil<CardShape> {
|
|||
}
|
||||
}
|
||||
|
||||
getBounds(shape: Shape) {
|
||||
getBounds(shape: CardShape) {
|
||||
return new Box2d(0, 0, shape.props.w, shape.props.h)
|
||||
}
|
||||
|
||||
component(shape: Shape) {
|
||||
component(shape: CardShape) {
|
||||
return (
|
||||
<HTMLContainer>Hello</HTMLContainer>
|
||||
)
|
||||
}
|
||||
|
||||
indicator(shape: Shape) {
|
||||
indicator(shape: CardShape) {
|
||||
return (
|
||||
<rect width={shape.props.w} height={shape.props.h}/>
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue