Skip to content

Commit

Permalink
Fixes duplicate node id.
Browse files Browse the repository at this point in the history
Both the root node and the first node get id: 1, although it doesn't matter with a nested Tree.
It is an issue when experimenting with different tree strategies that rely on unique node id's.
  • Loading branch information
wouterlucas committed Dec 5, 2023
1 parent 7845b78 commit f008233
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/render-drivers/main/MainCoreDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import type {
INodeWritableProps,
ITextNodeWritableProps,
} from '../../main-api/INode.js';
import { MainOnlyNode } from './MainOnlyNode.js';
import { MainOnlyNode, getNewId } from './MainOnlyNode.js';
import { Stage } from '../../core/Stage.js';
import type {
RendererMain,
Expand All @@ -44,7 +44,7 @@ export class MainCoreDriver implements ICoreDriver {
canvas: HTMLCanvasElement,
): Promise<void> {
this.stage = new Stage({
rootId: 1,
rootId: getNewId(),
appWidth: rendererSettings.appWidth,
appHeight: rendererSettings.appHeight,
deviceLogicalPixelRatio: rendererSettings.deviceLogicalPixelRatio,
Expand Down

0 comments on commit f008233

Please sign in to comment.