memo
/
1.5.0
memo 1.5.0
Install from the command line:
Learn more about npm packages
$ npm install @virtualstate/memo@1.5.0
Install via package.json:
"@virtualstate/memo": "1.5.0"
About this version
memo for JSX values.
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));