Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/xml_renderer/src/getKeyForNode.ts>getKeyForNode

An npm/browser module for easy matching XML and XPath to React Components and other stuff
Go to Latest
function getKeyForNode
import { getKeyForNode } from "https://deno.land/x/xml_renderer@5.0.7/src/getKeyForNode.ts";

Utility function to generate a unique key for a given node. Is automatically used as the key prop in case you're using Registry.createReactRenderer, but you may find it useful in other scenarios too.

Parameters

node: Node & { hasAttribute?: (name: string) => boolean; getAttribute?: (name: string) => string; }
optional
identifierAttribute = [UNSUPPORTED]