annotate canvas events (#2397)
Adds annotation to the canvas events example ### Change Type - [ ] `patch` — Bug fix - [ ] `minor` — New feature - [ ] `major` — Breaking change - [ ] `dependencies` — Changes to package dependencies[^1] - [x] `documentation` — Changes to the documentation only[^2] - [ ] `tests` — Changes to any test code only[^2] - [ ] `internal` — Any other changes that don't affect the published package[^2] - [ ] I don't know [^1]: publishes a `patch` release, for devDependencies use `internal` [^2]: will not publish a new version ### Test Plan 1. Add a step-by-step description of how to test your PR here. 2. - [ ] Unit Tests - [ ] End to end tests ### Release Notes - Adds annotation to the canvas events example
This commit is contained in:
parent
2944c46618
commit
9f336c0128
1 changed files with 9 additions and 0 deletions
|
@ -2,6 +2,8 @@ import { TLEventInfo, Tldraw } from '@tldraw/tldraw'
|
||||||
import '@tldraw/tldraw/tldraw.css'
|
import '@tldraw/tldraw/tldraw.css'
|
||||||
import { useCallback, useState } from 'react'
|
import { useCallback, useState } from 'react'
|
||||||
|
|
||||||
|
// There's a guide at the bottom of this file!
|
||||||
|
|
||||||
export default function CanvasEventsExample() {
|
export default function CanvasEventsExample() {
|
||||||
const [events, setEvents] = useState<string[]>([])
|
const [events, setEvents] = useState<string[]>([])
|
||||||
|
|
||||||
|
@ -41,3 +43,10 @@ export default function CanvasEventsExample() {
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
This example shows how to listen to canvas events. This includes things like pointer and
|
||||||
|
keyboard events, but not things such as undo/redo, create/delete shapes, etc. Those are store events.
|
||||||
|
|
||||||
|
To listen to changes to the store, check out the store events example.
|
||||||
|
*/
|
||||||
|
|
Loading…
Reference in a new issue