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

Throw error for missing as prop #2195

Merged
merged 1 commit into from
Jul 21, 2023
Merged

Throw error for missing as prop #2195

merged 1 commit into from
Jul 21, 2023

Conversation

connor-baer
Copy link
Member

@connor-baer connor-baer commented Jul 21, 2023

Purpose

The Title, Headline, and SubHeadline components no longer default to the h2 element. Developers need to specify the element explicitly so that they are forced to consider the correct heading level.

When the as prop is missing, React throws a generic error message that makes it difficult to pinpoint in which component the error occurred.

Approach and changes

  • Added a helpful error message when the as prop isn't provided to the Title, Headline, and SubHeadline components

Definition of done

  • Development completed
  • Reviewers assigned
  • Unit and integration tests
  • Meets minimum browser support
  • Meets accessibility requirements

@changeset-bot
Copy link

changeset-bot bot commented Jul 21, 2023

🦋 Changeset detected

Latest commit: adef67b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@sumup/circuit-ui Minor
@sumup/eslint-plugin-circuit-ui Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Jul 21, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
oss-circuit-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 21, 2023 6:59pm

@codecov
Copy link

codecov bot commented Jul 21, 2023

Codecov Report

Merging #2195 (adef67b) into next (b5b0df1) will decrease coverage by 0.05%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             next    #2195      +/-   ##
==========================================
- Coverage   96.56%   96.52%   -0.05%     
==========================================
  Files         259      259              
  Lines       20523    20544      +21     
  Branches     1928     1931       +3     
==========================================
+ Hits        19818    19830      +12     
- Misses        702      711       +9     
  Partials        3        3              
Impacted Files Coverage Δ
...ckages/circuit-ui/components/Headline/Headline.tsx 94.54% <100.00%> (-5.46%) ⬇️
.../circuit-ui/components/SubHeadline/SubHeadline.tsx 93.75% <100.00%> (-6.25%) ⬇️
packages/circuit-ui/components/Title/Title.tsx 94.54% <100.00%> (-5.46%) ⬇️

@connor-baer connor-baer marked this pull request as ready for review July 21, 2023 19:46
@connor-baer connor-baer requested a review from a team as a code owner July 21, 2023 19:46
@connor-baer connor-baer requested review from pdrmdrs and removed request for a team July 21, 2023 19:46
@connor-baer connor-baer merged commit 6f992ae into next Jul 21, 2023
7 of 8 checks passed
@connor-baer connor-baer deleted the feature/element-errors branch July 21, 2023 19:46
This was referenced Aug 8, 2023
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.

1 participant