Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
react-numeric
Advanced tools
Changelog
[1.0.0] - 2019-07-02
autoFocus
, placeholder
unselectable
, size
and id
props for input added by @sbusch
Added changelog
prop-types
moved to peer dependencies from dependencies.Readme
A react component for formatted number form fields
react-numeric is a wrapper component for autonumeric.
yarn add react-numeric
# or
npm install react-numeric --save
import ReactNumeric from 'react-numeric';
export function USDMoneyInput(props){
const { value } = props; // number typed
return (
<ReactNumeric
value={value}
currencySymbol="$"
minimumValue="0"
decimalCharacter="."
digitGroupSeparator=""
onChange={(event, value)=>{
console.log(event.target.value); // '1,234.5 $'
console.log(value); // 1234.5
}}
/>
);
}
// You can use predefinedOptions
import { predefinedOptions } from 'react-numeric';
export function PossitiveUSDMoneyInput(props){
const { value } = props; // number typed
return (
<ReactNumeric
value={value}
preDefined={predefinedOptions.dollarPos}
onChange={(e, value)=> this.setState({ value })}
/>
);
}
// if you want to store value as string typed
export function NumberInput(props){
const { value } = props; // string typed
return (
<ReactNumeric
value={value}
outputFormat="string"
onChange={(e, value)=> this.setState({ value })}
/>
);
}
FAQs
A react component for formatted number form fields
The npm package react-numeric receives a total of 1,216 weekly downloads. As such, react-numeric popularity was classified as popular.
We found that react-numeric 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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.