Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

3
Quick question - do I need keys when iterating over structures? (i.e. like in React)
Post Body

Hey everyone, beginner coder here following a CodeWithAntonio React tutorial and trying to replicate it in Sveltekit (doing well thus far).

I noticed that React requires a key for iterative structures, e.g:

<units.map((unit) => (
<div key={unit.id}>
<Unit />
</div>

Before I gave up learning React, I think I learned that this key helps React when modifying iterative structures to ensure it updates the right state for the right elements, etc. (or something like that). Do I need to include some sort of key in my {#each} blocks, etc. in Svelte? Or does Svelte work some magic here in the background for me? E.g:

{#each units as unit}
<div key={???}>
<Unit />
</div>
{#each}

Author
Account Strength
50%
Account Age
1 year
Verified Email
Yes
Verified Flair
No
Total Karma
2,940
Link Karma
1,170
Comment Karma
1,770
Profile updated: 5 days ago
Posts updated: 2 days ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
4 months ago