You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't understand where the Loader is being invoked or what the logic of it is:
The code below is close to verbatim from the Example in the components doc.
The Loader apparently comes after the submitForm(controlValues) inside handleFormData
import React, { useState } from 'react';
import Form from '@mapbox/mr-ui/form';
import FormSubmit from '@mapbox/mr-ui/form-submit';
import ControlText from '@mapbox/mr-ui/control-text';
// import validateRequired from '@mapbox/mr-ui/validators/validate-required';
function validateNoOp(value) {
console.log('val', value);
return '';
}
const formConfig = {
name: {
label: 'Search term',
placeholder: 'Text to match in profiles',
validator: validateNoOp, // validateRequired('Your name'),
},
};
I don't understand where the Loader is being invoked or what the logic of it is:
The code below is close to verbatim from the Example in the components doc.
The Loader apparently comes after the submitForm(controlValues) inside handleFormData
import React, { useState } from 'react';
import Form from '@mapbox/mr-ui/form';
import FormSubmit from '@mapbox/mr-ui/form-submit';
import ControlText from '@mapbox/mr-ui/control-text';
// import validateRequired from '@mapbox/mr-ui/validators/validate-required';
function validateNoOp(value) {
console.log('val', value);
return '';
}
const formConfig = {
name: {
label: 'Search term',
placeholder: 'Text to match in profiles',
validator: validateNoOp, // validateRequired('Your name'),
},
};
const InputForm = (props) => {
const renderForm = (getControlProps, onSubmit) => {
return (
<>
<ControlText {...getControlProps('name')} />
</>
);
};
const submitForm = (values) => {
console.log('sub', values);
if (props.onSubmit) props.onSubmit(values);
};
const handleFormData = (controlValues) => {
console.log('handle', controlValues);
submitForm(controlValues);
return controlValues;
};
return (
);
};
export default InputForm;
The text was updated successfully, but these errors were encountered: