-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot pass formatter to Input #44
Comments
For |
Thanks for prompt answer. |
You can wrap Input to a new custom component with formatter supported. Like: const MyInput = props => {
const { value, onChange, formatter, parser } = props;
const newValue = formatter(value);
const newOnChange = value => onChange(parser(value));
const newProps = _.omit(props, ['value', 'onChange', 'formatter', 'parser']);
return <Input {...newProps} value={newValue} onChange={newOnChange} />
} |
Great, thanks for the support! I'll give it a try |
I would like to use
formatter
andparser
function to<Input>
or<InputNumber />
components, but can't figure out how to pass those functions.I've tried adding them to
widgetProps
, orgetValueProps
but that didn't seem to work.Thanks!
The text was updated successfully, but these errors were encountered: