Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

types: fix ref(false) type to Ref<boolean> #1028

Merged
merged 1 commit into from
Apr 22, 2020

Conversation

pikax
Copy link
Member

@pikax pikax commented Apr 22, 2020

if you do ref(false) the type generated is Ref<true>|Ref<false>

This fixes that

const foo = ref(false);

if (!foo.value) {
  foo.value = true; // error here
}

@yyx990803 yyx990803 merged commit 0bdd889 into vuejs:master Apr 22, 2020
@pikax pikax deleted the types/fix-boolean-types branch April 22, 2020 15:57
pikax added a commit to pikax/vue-next that referenced this pull request Apr 29, 2020
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.

2 participants