Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/afraid-chairs-share.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@lynx-js/react": patch
---

Add `__BACKGROUND__` guard on `onBackgroundSnapshotInstanceUpdateId` event to prevent bundling to main-thread on dev environment.
2 changes: 1 addition & 1 deletion packages/react/runtime/src/snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export const backgroundSnapshotInstanceManager: {
const si = values.get(id)!;
// For PreactDevtools, on first hydration,
// PreactDevtools can get the real snapshot instance id in main-thread
if (__DEV__) {
if (__DEV__ && __BACKGROUND__) {
lynx.getJSModule('GlobalEventEmitter').emit('onBackgroundSnapshotInstanceUpdateId', [
{
backgroundSnapshotInstance: si,
Expand Down
Loading