Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@rschpdr/react-money-input
Advanced tools
A currency text input for React that Just Works™
currency.js
enforced numeric float valuesFormik
npm install --save @rschpdr/react-money-input currency.js
import React, { useState } from "react";
import MoneyInput from "react-money-input";
function Example(props) {
const [amount, setAmount] = useState(0);
function handleChange(e) {
setAmount(e.target.value);
}
return <MoneyInput onChange={handleChange} value={amount} />;
}
export default Example;
Props | Options | Default | Description |
---|---|---|---|
className | string | '' | Regular React classname |
style | Styles object | {} | Regular React styles object |
currencyConfig | Currency configuration object |
| Config options for Number.toLocaleString method. See more |
customInput | Component Reference | undefined | Support for custom inputs e.g. Material UI TextField |
name | string | undefined | Regular name HTML property |
id | string | undefined | Regular id HTML property |
max | number | Number.MAX_SAFE_INTEGER | Maximum allowed value |
onChange | (event) => any | undefined | onChange event handler. event is a fake Synthetic Event with only value , name and id properties defined inside target |
value | number | undefined | Input value |
Simply pass the custom input component as a prop. Pass the custom input props directly to MoneyInput
:
import React, { useState } from "react";
import { TextField } from "@material-ui/core";
import MoneyInput from "react-money-input";
function Example(props) {
const [amount, setAmount] = useState(0);
function handleChange(e) {
setAmount(e.target.value);
}
return (
<MoneyInput
customInput={TextField}
variant="outlined"
label="Custom Input!"
onChange={handleChange}
value={amount}
/>
);
}
export default Example;
All contributions welcome! Feel free to raise issues or submit a PR.
This project is licensed under the MIT License - see LICENSE.md for details.
Go give them stars!
FAQs
A currency text input for React that Just Works™
The npm package @rschpdr/react-money-input receives a total of 678 weekly downloads. As such, @rschpdr/react-money-input popularity was classified as not popular.
We found that @rschpdr/react-money-input 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.