When I add (mount) 2 components on HTML page I receive "Uncaught TypeError: Cannot read property 'class' of undefined at mount$1" error
<body>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/riot+compiler.js">
</script>
<script type="riot/tag">
<dict2-app>dict2-app</dict2-app>
</script>
<dict2-app></dict2-app>
<script>
riot.mount('dict2-app')
</script>
<script type="riot/tag">
<dict3-app>dict3-app</dict3-app>
</script>
<dict3-app></dict3-app>
<script>
riot.mount('dict3-app')
</script>
</body>
The code works properly when I comment one of //riot.mount('dict{X}-app')
You don't need to call multiple riot.mount, you need only one like below:
Your code will be: