react-form-builder
react-form-builder copied to clipboard
How to save data from a custom component
Anyone know how to save the input's data from a custom component
I added a custom component and its taking in the props correctly but I don't know how to safve the data, it simply never saves the data like other built in inputs do.
There is example of custom component https://github.com/Kiho/react-form-builder/blob/master/examples/custom/app.js#L14
const MyInput = React.forwardRef((props, ref) => {
const { name, defaultValue, disabled } = props;
return <input ref={ref} name={name} defaultValue={defaultValue} disabled={disabled} />;
});
Your custom component should have input element with ref associated with it.