![Malicious npm Package Typosquats react-login-page to Deploy Keylogger](https://cdn.sanity.io/images/cgdhsj6q/production/007b21d9cf9e03ae0bb3f577d1bd59b9d715645a-1024x1024.webp?w=400&fit=max&auto=format)
Research
Security News
Malicious npm Package Typosquats react-login-page to Deploy Keylogger
Socket researchers unpack a typosquatting package with malicious code that logs keystrokes and exfiltrates sensitive data to a remote server.
react-infinity-menu
Advanced tools
Readme
npm install react-infinity-menu
import InfinityMenu from "react-infinity-menu";
import "react-infinity-menu/src/infinity-menu.css";
class Example extends React.Component {
onNodeMouseClick(event, tree, node, level) {
this.setState({
tree: tree
});
}
onLeafMouseClick(event, leaf) {
console.log( leaf.id ); // Prints the leaf id
console.log( leaf.name ); // Prints the leaf name
}
onLeafMouseUp(event, leaf) {
console.log( leaf.id ); // Prints the leaf id
console.log( leaf.name ); // Prints the leaf name
}
onLeafMouseDown(event, leaf) {
console.log( leaf.id ); // Prints the leaf id
console.log( leaf.name ); // Prints the leaf name
}
render() {
return (
<InfinityMenu
tree={this.state.tree}
onNodeMouseClick={this.onNodeMouseClick}
onLeafMouseClick={this.onLeafMouseClick}/*optional*/
onLeafMouseDown={this.onLeafMouseDown}/*optional*/
onLeafMouseUp={this.onLeafMouseUp}/*optional*/
/>
);
}
}
A tree to represent the folder structure. Here is the example data you could pass into the tree props.
[
{
name: "menu1", /*require*/
id: 1, /*require*/
isOpen: true, /*require*/
customComponent: YOUR_OWN_COMPONENT_FOR_MENU,
children: [
{
name: "submenu1",
id: 1,
isOpen: true,
customComponent: YOUR_OWN_COMPONENT_FOR_SUB_MENU,
children: [
{
name: "item1-1",
id: 1
},
{
name: "item1-2",
id: 2
}
]
},
{
name: "submenu2",
id: 2,
isOpen: true,
customComponent: YOUR_OWN_COMPONENT_FOR_SUB_MENU,
children: [
{
name: "item2-1",
id: 1
}
]
}
]
},
{
name: "menu2", /*require*/
id: 2, /*require*/
isOpen: true, /*require*/
customComponent: YOUR_OWN_COMPONENT_FOR_MENU,
children: [
{
name: "item3-1",
id: 1
}
]
}
];
headerContent
is passed in to InfinityMenu
. It is rendered above the tree subcomponent.
headerProps
is an optional prop of InfinityMenu. The props in this object are passed as props to a headerContent
component. This is useful when extending InfinityMenu.
Passing the following into InfinityMenu as the headerProps
prop sets the title
prop on the headerContent component.
{
title: "my great title"
}
customComponent
at the node level, you will receive props key
, onClick
, name
, isOpen
, data
and isSearching
.customComponent
at the leaf level, you will receive props key
, onMouseDown
, onMouseUp
, onClick
, name
, icon
and data
.This function will get call when user click on the folder(node).
The function arguments include event
, tree
, node
and level
.
event
is the mouse click event.
tree
is the updated tree, you should update your own tree accordingly.
node
is the folder(node) the user clicked on. Including the id, name, isOpen and children.
level
is the distance from the root.
Bind to the onClick on the leaf.
This function will get call when user click on the item(leaf).
The function arguments include event
, leaf
.
event
is the click event.
leaf
is the item user clicked on. Includes name, id and all data the user inputs when they pass in the tree.
Bind to the onMouseDown on the leaf.
This function will get call when user mouse down on the item(leaf).
The function arguments include event
, leaf
.
event
is the click event.
leaf
is the item user clicked on. Includes name, id and all data the user inputs when they pass in the tree.
Bind to the onMouseUp on the leaf.
This function will get call when user mouse up on the item(leaf).
The function arguments include event
, leaf
.
event
is the click event.
leaf
is the item user clicked on. Includes name, id and all data the user inputs when they pass in the tree.
This function will get call when use click the cross on the menu
There is a default style sheet you can use if you so desire.
/src/infinity-menu.css
FAQs
Unknown package
The npm package react-infinity-menu receives a total of 61 weekly downloads. As such, react-infinity-menu popularity was classified as not popular.
We found that react-infinity-menu demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 28 open source maintainers 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 unpack a typosquatting package with malicious code that logs keystrokes and exfiltrates sensitive data to a remote server.
Security News
The JavaScript community has launched the e18e initiative to improve ecosystem performance by cleaning up dependency trees, speeding up critical parts of the ecosystem, and documenting lighter alternatives to established tools.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.