Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
react-lazy-tree
Advanced tools
Recursively render tree data structures.
Control tree node markup, content and style.
Render lazily or greedily.
Specify vertical animation, CSS classes, initial active node, and more.
Please see demo site and example code.
npm install --save react-lazy-tree
import ReactLazyTree from 'react-lazy-tree'
...
<ReactLazyTree {...{
data: tree,
mapInitialActiveNode: (node) => node.label === 'Dresses',
mapListClassName: ({ depth }) => {
const exampleDepth = `example--depth-${depth}`;
return `example ${exampleDepth}`;
},
mapListItemClassName: ({ isOnActivePath }) => {
const modifier = isOnActivePath ? 'expanded' : 'contracted';
const nodeIcon = `example__node--${modifier}`;
return `example__node ${nodeIcon}`;
},
mapNodeContent: ({ depth, isActiveNode }) => {
const labelDepth = `example__label--${depth}`;
const isActive = isActiveNode ? 'example__label--active' : '';
const className = `example__label ${labelDepth} ${isActive}`;
return (
<Label {...{
className,
text: node.label
}}/>
);
},
onActiveNodeChanged: activeNodeChangedHandler
}}/>
data
- Tree data structure, or a collection of tree data structures.
mapNodeContent
- Specify content, markup, and style for tree node presentation.
depth
: Numberindex
: NumberisActiveNode
: BooleanisLeafNode
: BooleanisOnActivePath
: Booleannode
: ObjectchildrenPropertyName
- Specify data node children property name.
children
mapListClassName
- Specify HTML list (UL) class names.
depth
: NumberisOnActivePath
: Booleannode
: ObjectmapListItemClassName
- Specify HTML list-item (LI) class names.
depth
: NumberisActiveNode
: BooleanisLeafNode
: BooleanisOnActivePath
: Booleannode
: ObjectmapInitialActiveNode
- Specify a node that should be active initially.
node
: ObjectonActiveNodeChanged
- Handle active node changes as a result of user interaction.
activePath
: Stringdepth
: Numbere
: Objectindex
: Numbernode
: ObjectinteractiveStartDepth
- Specify at what depth the rendered tree should become interactive. Depth is zero based.
-1
.shouldLazyRender
- Specify should tree nodes be rendered when becoming visible or at mount time.
shouldShowAllNodes
- Specify the entire tree should be rendered initially.
shouldLazyRender
and mapInitialActiveNode
verticalAnimationConfig
- Specify CSS transition duration and timing.
durationInMs
: Numbertiming
: Keyword | FunctiondurationInMs
: 300timing
: ease-inPlease open an issue.
git clone https://github.com/ethanselzer/react-lazy-tree.git
cd react-lazy-tree/example
npm install
npm start
git clone https://github.com/ethanselzer/react-lazy-tree.git
cd react-lazy-tree
npm install
See available commands:
npm run
Please contribute using Github Flow. Create a branch, add commits, and open a pull request.
You are awesome! ✨💫
MIT
FAQs
A React Treeview Component
We found that react-lazy-tree demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.