I'm a bit confused with Svelte's props.I have a component named Assignment
which I will use in my Board
component.I wish to have a dynamic array prop in my Assignment
's {#each} block.
<script> export let array</script><div {array} class="flex-column"><div class="row-item"><h4>Open</h4> {#each {array} as value}<div class="description"><p>{value.status}</p><p>{value.name}</p></div> {/each}</div></div>
Above is my Assignment
component
My wish is for me to able to do something like this:
<div class="flex-container"><Assignment {myArray} /><Assignment {myArray2} /></div>
With a new array in each component call. So I guess my question is: How do I pass a prop into a each block?