0.3.7 • Published 6 years ago
react-multi-email-custom v0.3.7
react-multi-email-custom
This pretends to be a custom version of http://react-multi-email.axisj.com/.
please vitit http://react-multi-email.axisj.com/ for the original version
Installation
npm install react-multi-email-custom -S
Usage
import * as React from 'react';
import { ReactMultiEmailCustom } from 'react-multi-email-custom';
import 'react-multi-email-custom/style.css';
class Basic extends React.Component {
state = {
emails: [],
};
render() {
const { emails } = this.state;
const myStyle = {};
return (
<>
<Segment>
<Form>
<Form.Field>
<label>Email</label>
<ReactMultiEmailCustom
style={myStyle}
emails={emails}
onChange={_emails => {
this.setState({ emails: _emails });
}}
getLabel={(
email,
index,
removeEmail,
) => {
return (
<Label key={index}>
{email}
<Icon name="delete" onClick={() => removeEmail(index)} />
</Label>
);
}}
/>
</Form.Field>
<Form.Field>
<label>react-multi-email-custom value</label>
{emails.join(', ') || 'empty'}
</Form.Field>
</Form>
</Segment>
</>
);
}
}