Form component ends in Loader
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 90
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
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 (
<>
);
};
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;
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the components documentation example shown in the issue, then trace the Form and FormSubmit components and the handleFormData callback to identify where the Loader appears. Document the invocation and control flow clearly, including what the example should show so users can understand the resulting behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- documentation, frontend
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100