Since I'm changing a React project to SvelteKit, I've got a specific situation that made me a lot curious about it.
Let's suppose that I do have a component in React that receives the object columnsMockExample as props, for example, and consumes an HTML inside of the object, as:
const columnsMockExample = [{name: 'Column 1', html: '<div>Inner HTML example</div>' }]
<ColumnsComponent columnsProp={columnsMockExample}/>
So, in React, we could map this object to consume it and show every .html inside of columnsMockExample:
{props.columnsProp.map((columnFromMockExample) => columnFromMockExample.html)};
So then, here is the question: as SvelteKit has the <script/> tag apart from the HTML, how can I create my object columnsMockExample inside of the SvelteKit<script/> tag since it is not JSX?
wrong SvelteKit script example is written below:
<script>
const columnsMockExample = [{name: 'Column 1', html: '<div>Inner HTML example</div>' }]
</script>
Thank you.