Skip to content

docs: explain reactive state cloning caveats - #3490

Open
Doomguy-BFG9000 wants to merge 1 commit into
vuejs:mainfrom
Doomguy-BFG9000:docs/3223-reactive-cloning-caveats
Open

Doomguy-BFG9000 wants to merge 1 commit into
vuejs:mainfrom
Doomguy-BFG9000:docs/3223-reactive-cloning-caveats

Conversation

@Doomguy-BFG9000

Copy link
Copy Markdown

Description of Problem

The toRaw() reference does not explain its limits when cloning reactive state. Unwrapping the outer proxy can still leave nested reactive objects or refs in the raw data.

Addresses the cloning guidance requested in #3223.

Proposed Solution

Explain that toRaw() returns the original object, show when structuredClone(toRaw(state)) can be used, and state that nested reactive values must also be converted to supported plain data. This adds the caveat without prescribing a general cloning utility or library.

Additional Information

Validation: the full site build passed with pnpm 10.33.0. Ten Node assertions with Vue 3.5.42 checked direct proxy rejection, raw-object identity, an independent deep clone of plain data, nested proxy rejection, and preservation of nested refs in raw data. The paragraph was inspected in Chrome at 1440px and 390px, with no horizontal overflow or page errors.

@netlify

netlify Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for vuejs ready!

Name Link
🔨 Latest commit 9d16201
🔍 Latest deploy log https://app.netlify.com/projects/vuejs/deploys/6aed67c416e9df31edc0f0bd
😎 Deploy Preview https://deploy-preview-3490--vuejs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant