title: VueJS 3: updated() hook not called eventhough I update data inside mounted() hook
body: <p>So I have been trying to learn Vue, and I have a parent component which has an array thats empty initially, and an isLoading which is false. I use axios to fetch data inside the mounted hook, and update the array with the response data.
  To manage loading, I set isLoading to true before the axios call, and set it to false in the resolution of that axios call.</p>
  <p>I tried consoling my isLoading data in mounted() and updated() hooks, and updated hook doesnt seem to be called at all.</p>
  <p>The actual problem I am trying to solve is, I am passing these two data items inside provide() for another child component to use. The child component correctly shows the data that is fetched using axios in the parent, but isLoading prop is not updated inside the child component when accessed using inject.
  I have work arounds like I can check for the length of the array, but I really want to understand what is happening here and why.</p>
  <p>Providing the valid code snippets below, and any help would be greatly appreciated.</p>
  <p>Parent data, provide(), mounted and updated hooks:</p>
  <pre><code>data() {
      return {
        friends: [],
        isLoading: false,
      };
    },
    provide() {
      return {
        friends: this.friends,
        toggleFavourite: this.toggleFavourite,
        addFriend: this.addFriend,
        isLoading: this.isLoading,
      };
    },
    mounted() {
      this.isLoading = true;
      console.log(&quot;mounted -&gt; this.isLoading&quot;, this.isLoading);
      axios.get(*url*).then((res) =&gt; {
        Object.keys(res.data).forEach((key) =&gt; {
          this.friends.push({ ...res.data[key] });
        });
        this.isLoading = false;
        console.log(&quot;mounted -&gt; this.isLoading&quot;, this.isLoading);
      });
    },
    updated() {
      console.log(&quot;updated -&gt; this.isLoading&quot;, this.isLoading);
    },
  </code></pre>
  <p>Child inject:</p>
  <pre><code>inject: [&quot;friends&quot;, &quot;toggleFavourite&quot;, &quot;isLoading&quot;]
  
  </code></pre>
  <p>Child usage of isLoading:</p>
  <pre><code>&lt;span v-if=&quot;isLoading&quot;&gt;Loading...&lt;/span&gt;
    &lt;div class=&quot;friends-container&quot; v-else&gt;
      &lt;friend
        v-for=&quot;friend in friends&quot;
        :key=&quot;friend.id&quot;
        :name=&quot;friend.name&quot;
        :email=&quot;friend.email&quot;
        :hobbies=&quot;friend.hobbies&quot;
        :age=&quot;friend.age&quot;
        :rating=&quot;friend.rating&quot;
        :favourite=&quot;friend.favourite&quot;
        @toggle-fav=&quot;toggleFavourite&quot;
      &gt;&lt;/friend&gt;
    &lt;/div&gt;
  </code></pre>