Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
use-email-autocomplete
Advanced tools
📬 A React hook for email autocomplete inputs
This should work with other libraries including material-ui
.
Play with it here!
yarn add use-email-autocomplete OR npm i use-email-autocomplete
import useEmailAutocomplete from 'use-email-autocomplete'
const App = () => {
const { email, bind } = useEmailAutocomplete()
const onSubmit = () => /* you an use `email` from above just like from `state` */
return <input {...bind} />
}
export const EmailInput = ({ onChange, ...props }) => {
const { email, onChange: handleEmailChange, bind } = useEmailAutocomplete()
const handleChange = e => {
handleEmailChange(e)
onChange(email)
}
return <input {...bind} {...props} onChange={handleChange} value={email} />
}
Requires @material-ui/core: 4.0.0
and above.
import { TextField } from '@material-ui/core'
export const EmailInput = ({ onChange, ...props }) => {
const { email, onChange: handleEmailChange, bind } = useEmailAutocomplete()
const handleChange = e => {
handleEmailChange(e)
onChange(email)
}
return <TextField {...bind} {...props} onChange={handleChange} value={email} />
}
Option | Description |
---|---|
validation | If you don't want to validate, set this to false. Default is true |
domains | All email domains you want to autocomplete for. Defaults to a predefined array of email domains. |
const {
email, // value with suggestion
value, // same as email (used for binding to input)
onChange,
ref,
onBlur,
onFocus,
isValid,
bind, // spread this on an `input` or component and it will do the rest
} = useEmailAutocomplete({
domains: [],
validation: true,
})
FAQs
📭 React hook for email autocomplete inputs
The npm package use-email-autocomplete receives a total of 97 weekly downloads. As such, use-email-autocomplete popularity was classified as not popular.
We found that use-email-autocomplete 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.