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
pull/2402/head
Taha 2024-01-03 13:54:24 +00:00 zatwierdzone przez GitHub
rodzic 2944c46618
commit 9f336c0128
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 9 dodań i 0 usunięć

Wyświetl plik

@ -2,6 +2,8 @@ import { TLEventInfo, Tldraw } from '@tldraw/tldraw'
import '@tldraw/tldraw/tldraw.css'
import { useCallback, useState } from 'react'
// There's a guide at the bottom of this file!
export default function CanvasEventsExample() {
const [events, setEvents] = useState<string[]>([])
@ -41,3 +43,10 @@ export default function CanvasEventsExample() {
</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.
*/