Vue 3: Issues with prop default value not updating when watching a parent property
I'm dealing with I'm working on a Vue 3 application where I need a child component to reactively update its default prop value based on a change in its parent's property. I have a parent component that holds a `count` value, and I'm trying to pass that to a child component as a prop. However, it seems like the child component doesn't update its internal state when the parent's `count` changes; instead, it maintains the initial value it received as a prop. Hereβs a simplified version of my code: Parent Component: ```vue <template> <div> <button @click="increment">Increment Count</button> <p>Current Count: {{ count }}</p> <ChildComponent :count="count" /> </div> </template> <script> import ChildComponent from './ChildComponent.vue'; export default { components: { ChildComponent }, data() { return { count: 0 }; }, methods: { increment() { this.count++; } } }; </script> ``` Child Component: ```vue <template> <div> <p>Child Count: {{ internalCount }}</p> </div> </template> <script> export default { props: { count: { type: Number, default: 0 } }, data() { return { internalCount: this.count }; }, watch: { count(newCount) { this.internalCount = newCount; } } }; </script> ``` When I increment the count in the parent, the child displays the same initial value instead of updating to the new count. I see the following warning in the console: `Vue warn]: Prop "count" is declared but its value is never used.`. I've tried changing the default value of the prop and using computed properties, but I still face the same issue. What am I missing here? How can I ensure that the child component correctly updates its internal state when the parent's `count` changes? What's the correct way to implement this?