Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
antd-prompt
Advanced tools
An ant.design helper that auto create a Modal with an optional message prompting the user to input some text.
An ant.design helper that auto create a Modal with an optional message prompting the user to input some text.
Support antd v4.
npm i antd-prompt
import React, { component } from 'react';
import ReactDOM from 'react-dom';
import prompt from 'antd-prompt';
import { Button, message } from 'antd';
class App extends Component {
handler = async () => {
try {
const name = await prompt({
title: "Please enter name",
placeholder: "Your name",
rules: [
// check this link for more help: https://ant.design/components/form/#Validation-Rules
{
required: true,
message: "You must enter name"
}
],
modalProps: {
width: '80%'
}
});
} catch (e) {
message.error('Please enter name');
}
}
render() {
return <div>
<Button onClick={this.handler}>Set Name</Button>
</div>
}
}
ReactDOM.render(<App />, document.getElementById('root'));
import React, { component } from 'react';
import ReactDOM from 'react-dom';
import prompt from 'antd-prompt';
import { Button, message } from 'antd';
class App extends Component {
handler = async () => {
await prompt({
title: "Please enter name",
value: 'Initial Value',
modalProps: {
width: '80%'
},
onOk: name => {
// do something with name
return false;
// or return Promise.resolve(false);
}
});
}
render() {
return <div>
<Button onClick={this.handler}>Set Name</Button>
</div>
}
}
ReactDOM.render(<App />, document.getElementById('root'));
FAQs
An ant.design helper that auto create a Modal with an optional message prompting the user to input some text.
We found that antd-prompt 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.