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

fix(EmptyState): added useId handling for older react version #6620

Merged

Conversation

elycheea
Copy link
Contributor

@elycheea elycheea commented Dec 18, 2024

Reopened on behalf of @sean-anderson-ibm

Closes #6606 and #6607

Fixes useId use in react 17 and below, due to useId only being in react 18 and above. Falls back to previous method of id generation for react versions <18.

What did you change?

I added a util function to change how useId works based on react version support and updated references to it

How did you test and verify your work?

I linked the build package to a repo using react 16, and verified the issue was no longer present.

@elycheea elycheea requested a review from a team as a code owner December 18, 2024 19:37
@elycheea elycheea requested review from makafsal and anamikaanu96 and removed request for a team December 18, 2024 19:37
Copy link

codecov bot commented Dec 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (release/v2.56.1@a8985c2). Learn more about missing BASE report.

Additional details and impacted files
@@                Coverage Diff                 @@
##             release/v2.56.1    #6620   +/-   ##
==================================================
  Coverage                   ?   79.99%           
==================================================
  Files                      ?      395           
  Lines                      ?    12896           
  Branches                   ?     4274           
==================================================
  Hits                       ?    10316           
  Misses                     ?     2580           
  Partials                   ?        0           
Components Coverage Δ
ibm-products ∅ <0.00%> (?)
ibm-products-web-components ∅ <0.00%> (?)

@elycheea elycheea merged commit 45af420 into carbon-design-system:release/v2.56.1 Dec 18, 2024
19 of 26 checks passed
@elycheea elycheea deleted the 6607-useid-patch branch December 18, 2024 21:23
github-merge-queue bot pushed a commit that referenced this pull request Dec 18, 2024
* chore(telemetry): update telemetry config

* chore(release): publish [skip ci]

 - [email protected]
 - @carbon/[email protected]
 - @carbon/[email protected]
 - @carbon/[email protected]
 - @carbon/[email protected]
 - @carbon/[email protected]

* chore(release): publish [skip ci]

 - [email protected]
 - @carbon/[email protected]
 - @carbon/[email protected]
 - @carbon/[email protected]
 - @carbon/[email protected]
 - @carbon/[email protected]

* fix(EmptyState): added useId handling for older react version (#6620)

* fix(EmptyState): added useId handling for older react version

* fix(EmptyState): fixed imports for useId

---------

Co-authored-by: Sean Anderson <[email protected]>

* chore(release): publish [skip ci]

 - @carbon/[email protected]

---------

Co-authored-by: carbon-bot <[email protected]>
Co-authored-by: elysia <[email protected]>
Co-authored-by: Sean Anderson <[email protected]>
Co-authored-by: elysia <[email protected]>
github-merge-queue bot pushed a commit that referenced this pull request Dec 19, 2024
* chore(telemetry): update telemetry config

* chore(release): publish [skip ci]

 - [email protected]
 - @carbon/[email protected]
 - @carbon/[email protected]
 - @carbon/[email protected]
 - @carbon/[email protected]
 - @carbon/[email protected]

* chore(release): publish [skip ci]

 - [email protected]
 - @carbon/[email protected]
 - @carbon/[email protected]
 - @carbon/[email protected]
 - @carbon/[email protected]
 - @carbon/[email protected]

* fix(EmptyState): added useId handling for older react version (#6620)

* fix(EmptyState): added useId handling for older react version

* fix(EmptyState): fixed imports for useId

---------

Co-authored-by: Sean Anderson <[email protected]>

* chore(release): publish [skip ci]

 - @carbon/[email protected]

* chore(release): publish [skip ci]

 - @carbon/[email protected]

---------

Co-authored-by: carbon-bot <[email protected]>
Co-authored-by: elysia <[email protected]>
Co-authored-by: Sean Anderson <[email protected]>
Co-authored-by: Matt Gallo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants