
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@flexcodelabs/use-drag-drop-hook
Advanced tools
[](https://www.npmjs.com/package/@flexcodelabs/use-drag-drop-hook) [](https://www.npmjs.com/package/@flexcodelabs/use
npm install @flexcodelabs/use-drag-drop-hook
or
yarn add @flexcodelabs/use-drag-drop-hook
...
import useDragAndDrop from '@flexcodelabs/use-drag-drop-hook';
// inside React Fn
const {
dragOver, // returns true if drag over event triggered
setDragOver, // update drag over state
onDragOver, // a function to be called onDrag event
onDragLeave, // a function to be called on drag leave
fileDropError, // returns error if there is any on file drop
setFileDropError, // set errors especially used on validation
} = useDragAndDrop()
...
import useDragAndDrop from '@flexcodelabs/use-drag-drop-hook';
const Test = () => {
const {
dragOver,
onDragOver,
onDragLeave,
fileDropError,
setFileDropError,
} = useDragAndDrop();
const [file, setFile] = useState<any>(null);
const onDrop = (e: any) => {
e.preventDefault();
if (e.dataTransfer.files[0]?.size > 10000) {
setFileDropError("Invalid file size");
}
// do something with the file
setFile(e.dataTransfer.files[0]);
};
return (
<div>
<label
onDrag={onDragOver}
onDragOver={onDragOver}
onDragLeave={onDragLeave}
onDrop={onDrop}
>
{file && <p>{file?.name}</p>}
Drag and Drop your files here
<input type="file" />
{fileDropError && <p>{fileDropError}</p>}
<p>{dragOver && "Drop your files here"}</p>
<p>Max file size = 10Kb</p>
</label>
</div>
);
};
FAQs
[](https://www.npmjs.com/package/@flexcodelabs/use-drag-drop-hook) [](https://www.npmjs.com/package/@flexcodelabs/use
We found that @flexcodelabs/use-drag-drop-hook demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.