
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
react-nested-tree2
Advanced tools
react-nested-tree2 is a flexible React component library for rendering nested tree structures. This package allows you to easily create and manage tree components with customizable rendering for both branches and leaves.
To install react-nested-tree2, use npm:
npm install react-nested-tree2
Or with yarn:
yarn add react-nested-tree2
To use react-nested-tree2 in your project, import the TreeRoot component and provide it with data and rendering functions for the branches and leaves.
import React from "react";
import { TreeRoot } from "react-nested-tree2";
const App = () => {
return (
<TreeRoot<{ name: string }, { name: string }>
style={{ marginLeft: "20px" }}
data={{
id: "root",
children: [
{
id: 1,
data: { name: "* Branch 1" },
children: [
{ id: 2, data: { name: "- Leaf 1-1" } },
{ id: 3, data: { name: "- Leaf 1-2" } },
{
id: 4,
data: { name: "* Branch 1-4" },
children: [{ id: 5, data: { name: "- Leaf 1-4-1" } }],
},
],
isToggled: true,
},
{
id: 2,
data: { name: "* Branch 2" },
children: [{ id: 5, data: { name: "- Leaf 2-1" } }],
isToggled: false,
},
],
}}
renderLeaf={(leaf) => {
return <p>{leaf.name}</p>;
}}
renderBranch={(treeData) => {
return <button onClick={onToggle}>{branch.name}</button>;
}}
/>
);
};
export default App;
The TreeRoot component accepts the following props:
TreeRoot component.Distributed under the MIT License. See LICENSE for more information.
FAQs
A headless and configurable nested React tree component
We found that react-nested-tree2 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.