Reactive behavior is not working properly for Provide + Inject scenario
Version
3.0.5
Reproduction link
Steps to reproduce
Reproduction code is attached in the url
What is expected?
I have a parent and child components. When there is a mutation through a function, and the value is not reflected even if the reactive behavior is enforced. I have attached a sample code in the url.
What is actually happening?
The value should be updated when I press the button
I am not sure whether I have missed out anything.
You need to either create a computed or a toRef()
out of store.state.value
. Otherwise, you are reading the value once. only
const value = toRef(store.state, 'count');
const value = computed(() => store.state.count);
Remember to use the forum or the Discord chat to ask questions!