Skip to content

While putting destructured props into toRefs the warning appears [Vue warn] toRefs() expects a reactive object but received a plain one. #13171

Open
@avinean

Description

@avinean

Vue version

3.5.13

Link to minimal reproduction

https://play.vuejs.org/#eNqFkj1PwzAQhv+K5SWtFDlChaUKSIA6wABVYbSEquRSXBLbsp1Qqep/585JSocWtvt4znrvPe/5vbWia4HPee4Lp2xgHkJr76RWjTUusEfTWFY507BEZJQQnkidZz2PJCYBGluvA2DGWF6qLgYYxvGsL2d9Pc9OaJ7y4AujK7URW280CtkTLHmBk6oG92qDMtpLPmexQ711XZvv51gLroV0rBefUHydqW/9jmqSLx14cB1IfuyFtdtA6NuLtxfYYXxsNqZsa6T/aK7Am7oljT320OoSZZ9wUe1TtFPpzbtf7AJoPy5FQok8RF5ytJdMu7T6r9yZuI5zUh/QxfE0ly+5Z8GsoPIps850qgScHS7bn1RqPIQnUAiBjPUI3LISKqVhSflkStQwPkkQD2hJkg4vT+LQFKH/fseZv4A7fHTgyBfcYSZuxNWMH34AEnfgZw==

Steps to reproduce

  1. Create a component
  2. Call defineProps like this
    const { ...props } = defineProps()
  3. Put props into toRefs
    toRefs(props))

Note
this works fine
const props = defineProps() toRefs(props))

What is expected?

No warning

What is actually happening?

A warning appears [Vue warn] toRefs() expects a reactive object but received a plain one.

System Info

Any additional comments?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions