Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove function export wrappers #15498

Open
1 of 5 tasks
tay1orjones opened this issue Jan 4, 2024 · 2 comments
Open
1 of 5 tasks

Remove function export wrappers #15498

tay1orjones opened this issue Jan 4, 2024 · 2 comments
Assignees
Labels
planning: umbrella Umbrella issues, surfaced in Projects views role: dev 🤖 type: enhancement 💡 type: infrastructure 🤖 Issues relating to devops, tech debt, etc. version: 12 Issues pertaining to a future major release of Carbon

Comments

@tay1orjones
Copy link
Member

tay1orjones commented Jan 4, 2024

As part of v11, many components were upgraded from class components to function components, #9712.

When v11 was close to being released, there were a handful of components that were not upgraded and instead a createClassWrapper helper was added that would wrap these components with a functional export - #10281.

The problem

One downside with this approach is that users can no longer place a ref on these components (example). One workaround is to bypass the functional wrapper by importing the root class-based component. For example:

import Slider from '@carbon/react/es/components/Slider/Slider';

The solution

The remaining components using createClassWrapper need to be refactored to be functional components. This technically is a breaking change. We could place these changes behind a feature flag(s) to avoid the breaking change until our next major (v12)

Tasks

Preview Give feedback
@tay1orjones tay1orjones added type: enhancement 💡 role: dev 🤖 planning: umbrella Umbrella issues, surfaced in Projects views type: infrastructure 🤖 Issues relating to devops, tech debt, etc. labels Jan 4, 2024
@github-project-automation github-project-automation bot moved this to Triage in Roadmap Jan 4, 2024
Copy link
Contributor

github-actions bot commented Jan 4, 2024

Thank you for submitting a feature request. Your proposal is open and will soon be triaged by the Carbon team.

If your proposal is accepted and the Carbon team has bandwidth they will take on the issue, or else request you or other volunteers from the community to work on this issue.

@tay1orjones tay1orjones added the version: 12 Issues pertaining to a future major release of Carbon label Jan 4, 2024
@tay1orjones tay1orjones moved this to 🪆 Needs Refined in Design System Jan 4, 2024
@tay1orjones tay1orjones moved this from 🪆 Needs Refined to 🕵️‍♀️ Triage in Design System Jan 4, 2024
@sstrubberg sstrubberg moved this from Triage to v12 in Roadmap Jan 8, 2024
@fabdslv
Copy link

fabdslv commented Mar 5, 2024

Hello,

This problem prevents us from fixing an accessibility defect : our OverflowMenu has items that open a modal, and when we close the modal, there is no way to get focus back on the overflow menu button since we can't get ref.
The workaround doesn't work either for us because we use bx-- prefix which we can't set by importing the component directly.

@sstrubberg sstrubberg removed this from Roadmap Sep 10, 2024
@github-project-automation github-project-automation bot moved this to Triage in Roadmap Oct 9, 2024
@sstrubberg sstrubberg moved this from Triage to Next ➡ in Roadmap Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
planning: umbrella Umbrella issues, surfaced in Projects views role: dev 🤖 type: enhancement 💡 type: infrastructure 🤖 Issues relating to devops, tech debt, etc. version: 12 Issues pertaining to a future major release of Carbon
Projects
Status: Next ➡
Development

No branches or pull requests

2 participants