-
Notifications
You must be signed in to change notification settings - Fork 350
fix(Tipseen): resolve invalid HTML structure and ref/id prop issues #2799
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(Tipseen): resolve invalid HTML structure and ref/id prop issues #2799
Conversation
|
Bump |
PR Reviewer Guide 🔍(Review updated until commit e277623)Here are some key observations to aid the review process:
|
talkor
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @humza1400 ! And sorry for the long delay
Please just fix the lint issue (Prettier) and I'll merge
Thanks!!
No problem! Happy to help. I ran prettier on Looks like there's a pipeline failing for a missing Chromatic environment token which I'm assuming is normal for forked PRs. |
User description
Summary
This PR fixes two issues in the
Tipseencomponent:<Text>element’selement="p"withelement="div"to resolve invalid HTML structure when rendering nested<div>s inside<p>.idandrefprops onReact.Fragmentby conditionally rendering a<div>wrapper when necessary.Changes
elementprop inTextchanged from"p"to"div"to comply with HTML standards.<div>instead ofReact.Fragmentwhenidorrefis passed, avoiding React warnings.How I tested it
yarn storybookand verified no console warnings in the Tipseen stories.yarn testandyarn lintwith no issues related to my changes.Error Messages Before Fix
PR Type
Bug fix
Description
Fixes invalid HTML structure by changing
Textelement from<p>to<div>Resolves improper
refandidprop usage onReact.FragmentConditionally renders wrapper as
<div>only when necessaryAdds
ellipsis={false}prop toTextcomponent for consistencyDiagram Walkthrough
File Walkthrough
Tipseen.tsx
Fix HTML structure and conditional wrapper propspackages/core/src/components/Tipseen/Tipseen.tsx
Textcomponent'selementprop from"p"to"div"to fix invalidHTML nesting
ellipsis={false}prop toTextcomponentwrapperPropsobject to conditionally applyref,id, anddata-testidonly whenTipseenWrapperis adivTipseenWrapperJSX to use spreadwrapperPropsinstead ofdirect prop assignment, avoiding React warnings about invalid props on
Fragment