Add IDs to elements (#236)
* Add IDs to elements - Move round rect function within the renderer * Generate IDs using nanoid * If element ID does not exist, add the ID during restoration
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import { randomSeed } from "../random";
|
||||
import nanoid from "nanoid";
|
||||
|
||||
export function newElement(
|
||||
type: string,
|
||||
@ -14,6 +15,7 @@ export function newElement(
|
||||
height = 0
|
||||
) {
|
||||
const element = {
|
||||
id: nanoid(),
|
||||
type,
|
||||
x,
|
||||
y,
|
||||
|
Reference in New Issue
Block a user