Package Exports
- @path-tree/react
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@path-tree/react) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@path-tree/react
Usage
Install
yarn add @path-tree/react tslibBasic Usage
import * as React from "react";
import * as ReactDOM from "react-dom";
import * as PathTree from "@path-tree/react";
const props: PathTree.Props = {
pathItems: [
{
type: "file",
path: "a/b/index.js",
},
{
type: "file",
path: "a/b/c/index.js",
},
],
};
ReactDOM.render(<PathTree.Component {...props} />, document.querySelector("#root"));Define components
import * as PathTree from "@path-tree/react";
const props: PathTree.Props = {
FileComponent: (fileProps) => {
return <p>{fileProps.path}</p>;
},
DirectoryComponent: (directoryProps) => {
return <div>{directoryProps.children}</div>;
},
pathItems: [
{
type: "file",
path: "a/b/index.js",
},
{
type: "file",
path: "a/b/c/index.js",
},
],
};LICENSE
@path-tree/react is MIT licensed.