kopia lustrzana https://github.com/Tldraw/Tldraw
bfc8b6a901
We're missing the export for `createShapePropsMigrationIds`, so lets add it. This also fixes some other bits that were used in examples but not exported properly from tldraw. ### Change Type - [x] `sdk` — Changes the tldraw SDK - [x] `bugfix` — Bug fix ### Release Notes - Expose `createShapePropsMigrationIds`, `defaultEditorAssetUrls`, `PORTRAIT_BREAKPOINT`, `useDefaultColorTheme`, & `getPerfectDashProps` |
||
---|---|---|
.. | ||
README.md | ||
ShapeWithMigrationsExample.tsx | ||
snapshot.json |
README.md
title | component | category | priority |
---|---|---|---|
Shape with migrations | ./ShapeWithMigrationsExample.tsx | shapes/tools | 3 |
Migrate your shapes and their data between versions
Sometimes you'll want to update the way a shape works in your application. When this happens there can be a risk of errors and bugs. For example, users with an old version of a shape in their documents might encounter errors when the editor tries to access a property that doesn't exist. This example shows how you can use our migrations system to preserve your users' data between versions. It uses a snapshot to load a document with a shape that is missing a "color" prop, and uses the migrations method of the shape util to update it.