openedx / openedx/paragon

Export FormGroupContext / useFormGroupContext

Open Beginner friendly
#4,392 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.