Skip to content

toRef type error - says it unwraps refs but doesn't #4732

@denovodavid

Description

@denovodavid

Version

3.2.19

Reproduction link

codesandbox.io

Steps to reproduce

  1. Create a shallowReactive object with a deeply nested ref.
  2. Extract a property from it using toRef.
  3. Try to access the nested ref value.

What is expected?

The toRef type is a shallow unwrap, or it actually unwraps the nested ref.

What is actually happening?

The toRef type states the nested ref has been unwraped, when it has not been.


I ran into this issue when I was passing a prop down to a component which mirrors this setup. The props object is equivalent to the shallow reactive object and I wanted to get a ref to my prop, but then typescript started yelling at me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions