@virtualstate/memo
v1.8.0
Published
[memo](https://github.com/tc39/proposal-function-memo) for JSX values.
Downloads
6
Readme
@virtualstate/memo
memo for JSX values.
Support
Test Coverage
Usage
import { memo } from "@virtualstate/memo";
import { descendants } from "@virtualstate/focus";
import { Component, Body } from "./somewhere";
const tree = memo(
<>
<Component />
<main>
<Body />
</main>
</>
);
// On the first usage, the tree will be memo'd as it is read
console.log(await descendants(tree));
// Uses the memo'd version, Component & Body aren't called again
console.log(await descendants(tree));