diff --git a/app/docs/md/elements/state/instance-id.md b/app/docs/md/elements/state/instance-id.md index 2d2db9e0..e7732fff 100644 --- a/app/docs/md/elements/state/instance-id.md +++ b/app/docs/md/elements/state/instance-id.md @@ -2,7 +2,7 @@ title: Instance ID --- -`instanceID` is a unique identifier that is generated per Custom Element instance. This enables you to differentiate between multiple instances of the same element on a page. It can also be useful when using a string based diffing library like [Morphdom](https://github.com/patrick-steele-idem/morphdom) that require unique identifiers for DOM diffing. +`instanceID` is a unique identifier that is generated per Custom Element instance. This enables you to differentiate between multiple instances of the same element on a page. It can also be useful when using a string based diffing library like [Morphdom](https://github.com/patrick-steele-idem/morphdom) which keys on unique identifiers to know when to update versus replace an element. ```javascript export default function MyCard({ html, state }) { @@ -17,3 +17,7 @@ export default function MyCard({ html, state }) { ` } ``` + + + Pro tip: As in the example above, prefix the id with the element name in order to use the id with multiple child elements. +