Subscribe on changes!

Props is not reactive in production mode

avatar
Feb 18th 2021

Version

3.0.5

Reproduction link

https://github.com/sanjade/vue3-bug

Steps to reproduce

git clone https://github.com/sanjade/vue3-bug
cd vue3-bug && yarn install
(RUN IN PRODUCTION MODE BECAUSE THIS ISSUE DOESN'T OCCUR IN DEVELOPMENT MODE)
yarn build
yarn serve

What is expected?

I expect the "loading..." text to change to [0, 1, 2, 3, 4, 5, 6, 7, 8, 9].

What is actually happening?

In production mode, the data is added to the store after 2 seconds but the text keeps on saying "loading...". This doesn't happen in development mode.

avatar
Feb 18th 2021

You need to

    return () =>
      h(toRender, {
        attrs: { ...ctx.attrs },
      })

so Vue can track you are reading items from attrs