Export FormGroupContext / useFormGroupContext
Open
Beginner friendly
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 140
- Forks
- 100
- Avg merge
- 1h 3m
- Merged PRs (30d)
- 30
Description
For using custom form control elements with Form.Group, it could be helpful to access the controlId from the FormGroupContext. However, the FormGroupContext or useFormGroupContext is not exported from paragon, so it's not available.
For example:
<Form.Group>
<Form.Label>my custom form control</Form.Label>
<CustomControl />
</Form.Group>
const CustomControl = (props) => {
const { controlId } = useFormGroupContext();
return <MyControl id={controlId} />;
};
It would be great for this to be exported to support this use case.
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 by locating the FormGroupContext and useFormGroupContext entry points and the existing Form.Group exports. Expose the context or hook through the public Paragon exports, then verify that the custom-control example can access controlId through Form.Group.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100