Avoiding a stack overflows!

In our recipe, we used v-for to ensure that if there are no more taxa present, the taxon component will not even render. You should ensure, using v-if or v-for, that there is an end to your recursion. However, just for fun, you should make Vue explode at least once in your life.

Write the following component:

Vue.component('matrioska', {   template: '<p>Hello<matrioska></matrioska></p>' })

Then, put it in your Vue instance HTML:

<div id="app">   <matrioska></matrioska> </div>

You should receive the satisfying message from Vue:

vue.js:2269 Uncaught RangeError: Maximum call stack size exceeded

Get Vue.js 2 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.