Skip to content

console.log(user) returnsRef<undefined>, butconsole.log(user, user.value) return Ref<Object>, Reactive<Object> #2920

@mrleblanc101

Description

@mrleblanc101

Reproduction

https://stackblitz.com/edit/github-ugyyhuvm?file=components%2FHelloWorld.vue

Steps to reproduce the bug

Is this a regression ?
I have a very simple store that export an hardcoded user object.

I added this to my component:

const store = useAuthStore();
const { user } = storeToRefs(store);
console.log(user);
console.log(user, user.value);

The first console.log is undefined.
The second one is not:

Ref<undefined>
Ref<Object>, Reactive<Object>

Expected behavior

console.log(user); alone should return Ref<Object>.

Actual behavior

console.log(user); returns Ref<undefined>.

Additional information

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