@figspec/react
v2.0.0
Published
React binding for figspec
Downloads
2,902,279
Readme
@figspec/react
A React binding for @figspec/components
.
Installation
# npm
$ npm i @figspec/react
# Yarn
$ yarn add @figspec/react
# pnpm
$ pnpm add @figspec/react
Usage
See the docs at @figspec/components
.
This bindings enables you to use the CustomElement's property via React's component props. You don't need to use kebab-case attributes :camel::dash:
import { FigspecViewer } from "@figspec/react";
const logSelectedNode = (ev) => {
console.log(ev.detail.selectedNode);
};
<FigspecFrameViewer
nodes={nodes}
renderedImage={renderedImage}
zoomMargin={200}
onNodeSelect={logSelectedNode}
/>;