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

Warning: <X> cannot appear as a descendant of <p> #1003

Closed
meissadia opened this issue Oct 16, 2024 · 0 comments · Fixed by #1005
Closed

Warning: <X> cannot appear as a descendant of <p> #1003

meissadia opened this issue Oct 16, 2024 · 0 comments · Fixed by #1005
Assignees

Comments

@meissadia
Copy link
Collaborator

This is creating a LOT of noise in the dev consoles, obfuscating more important messages.

@meissadia meissadia self-assigned this Oct 16, 2024
@meissadia meissadia transferred this issue from cfpb/design-system-react Oct 16, 2024
@meissadia meissadia changed the title DSR: <p> cannot appear as a descendant of <p> Warning: <X> cannot appear as a descendant of <p> Oct 16, 2024
tanner-ricks pushed a commit that referenced this issue Oct 17, 2024
Closes #1003 

## Changes

- BetaAndLegalNotice: Refactor to avoid passing the entire content of
the notice via the `message` prop, which gets wrapped in a `<p>` in the
DSR.
- Loading: Replace `<div>` with a `<span>`

## How to test this PR

1. Start SBL Frontend: `yarn start`
2. Verify Beta/Legal notice looks the same
- `git checkout main` => `git checkout -b 1003-x-cannot-be-child-of-p`
3. Verify Loading looks the same
    - Visit http://localhost:8899/loading
- `git checkout main` => `git checkout -b 1003-x-cannot-be-child-of-p`

## Screenshots
| Before | After|
|---|---|

|Beta/Legal<br/><br/>![BetaLegal-before](https://github.com/user-attachments/assets/f7b45df0-36c8-46e5-ad03-6ddd4c1528dc)|Beta/Legal<br/><br/>![BetaLegal-after](https://github.com/user-attachments/assets/6a30873e-a990-4920-b781-94cc0098346a)|
|[Loading Video:
before](https://github.com/user-attachments/assets/ca1f3b44-e462-4e71-aa2b-99240c55c729)|[Loading
Video:
after](https://github.com/user-attachments/assets/ae7d2411-5714-4d0c-a814-221dd1983b93)|
|Console errors
![x-child-before](https://github.com/user-attachments/assets/f80ba69a-0818-49f9-84d3-c6cccb56b668)|Console
errors
![x-child-after](https://github.com/user-attachments/assets/b54ba1f0-0183-4032-addb-aa941e0d85eb)|
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant