Skip to content

Instantly share code, notes, and snippets.

@tryggvigy
Created January 10, 2018 23:33
Show Gist options
  • Save tryggvigy/17f9d8f01c458fd25e09497f774a8dbe to your computer and use it in GitHub Desktop.
Save tryggvigy/17f9d8f01c458fd25e09497f774a8dbe to your computer and use it in GitHub Desktop.
Krass
const users = [<User name="Fannar"/>, <User name="Tryggvi"/>]
before
<div>
{users.map((user, index) => <User key={index} name={user.name} />)}
</div>
after
<div>
{[<User key={user.id} name="Fannar"/>, <User key={} name="Tryggvi"/>]}
</div>
<User name="Fannar"/>
React.createComponent(User, { name : "fannar"}) === <User name="Fannar" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment