Browse Source

add crypto.randomUUID as source of keys (#4165)

Co-authored-by: Oliver Williams <oliver@Olivers-MacBook-Pro.local>
main
Oliver Williams 3 years ago
committed by GitHub
parent
commit
07dbd86ca4
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      beta/src/pages/learn/rendering-lists.md

2
beta/src/pages/learn/rendering-lists.md

@ -390,7 +390,7 @@ Fragments disappear from the DOM, so this will produce a flat list of `<h1>`, `<
Different sources of data provide different sources of keys:
* **Data from a database:** If your data is coming from a database, you can use the database keys/IDs, which are unique by nature.
* **Locally generated data:** If your data is generated and persisted locally (e.g. notes in a note-taking app), use an incrementing counter or a package like [`uuid`](https://www.npmjs.com/package/uuid) when creating items.
* **Locally generated data:** If your data is generated and persisted locally (e.g. notes in a note-taking app), use an incrementing counter, [`crypto.randomUUID()`](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/randomUUID) or a package like [`uuid`](https://www.npmjs.com/package/uuid) when creating items.
### Rules of keys {/*rules-of-keys*/}

Loading…
Cancel
Save