Skip to content

Instantly share code, notes, and snippets.

@mijms
Created Jul 22, 2021
Embed
What would you like to do?
import React, { Component } from 'react'
import { Input } from 'antd'
class text extends Component {
change = (ev) => {
const { field} = this.props
field.onChange({ target: { name: field.name, value: ev.target.value } });
// extra code after saving
}
render() {
const { field={}, placeholder, field_type='text'} = this.props
return (
<Input
type={field_type}
value={field.value}
onChange={this.change}
placeholder={placeholder}
name={field.name} />
)
}
}
export default text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment