Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

Commit

Permalink
perf: optimize update performance (#1777)
Browse files Browse the repository at this point in the history
Co-authored-by: fengbo <[email protected]>
  • Loading branch information
1198994985 and 1198994985 committed Dec 7, 2021
1 parent 3e6f830 commit 0e0a6b5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/remax-runtime/src/VNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,15 @@ export default class VNode {
return;
}

const parentPath = this.parent!.path;

for (let i = 0; i < payload.length; i = i + 2) {
const [propName, propValue] = toRawProps(payload[i], payload[i + 1], this.type);

let path = [...this.parent!.path, 'nodes', this.id.toString(), 'props'];
let path = [...parentPath, 'nodes', this.id.toString(), 'props'];

if (RuntimeOptions.get('platform') === 'ali') {
path = [...this.parent!.path, `children[${this.index}].props`];
path = [...parentPath, `children[${this.index}].props`];
}

this.container.requestUpdate({
Expand Down

0 comments on commit 0e0a6b5

Please sign in to comment.