Skip to content

Props state is not synced to the client from SSR when changed in onBeforeMount hook #7800

@AndrewBogdanovTSS

Description

@AndrewBogdanovTSS

Vue version

3.2.25

Link to minimal reproduction

https://stackblitz.com/edit/github-nevztk?file=src/pages/Home.vue

Steps to reproduce

  • Create isRed boolean reactive value using script setup
  • Set css class conditionally based on the value of isRed
  • Change the value of isRed in the onBeforeMount hook from false to true

What is expected?

  • DOM node text value is updated to true
  • .red class is applied to a DOM node

What is actually happening?

  • DOM node text value is updated to true
  • .red class is NOT applied to a DOM node

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 16.14.2 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 7.17.0 - /usr/local/bin/npm
  npmPackages:
    vue: ^3.2.25 => 3.2.47

Any additional comments?

When using onMounted hook issue is not present

Metadata

Metadata

Assignees

No one assigned

    Labels

    🍰 p2-nice-to-havePriority 2: this is not breaking anything but nice to have it addressed.scope: ssr

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions