Bug: AmountDisplay renders div inside p — invalid DOM nesting #9
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:open_issues
agents
agent:security_audit
agent:verify
area
timecurve
arena
arena-v2
audit
block:feature_review
block:security
bug
contracts
design
devops
docs
documentation
enhancement
epic
feature
frontend
indexer
low priority
megaeth
operations
ops
performance
QA
qa checklist
referrals
removal
security
smart-contracts
tech-debt
testing
time-arena
timecurve
visual-qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
code/yieldomega#9
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
TimeCurvePage: AmountDisplay.tsx line 21 renders a div inside a p element. React warns 'In HTML, div cannot be a descendant of p'. Will cause hydration errors in SSR. Visible in console on every page load.
Found on v1.4.0, local Anvil stack, commit
aaa52c9.still reproducing on
d9987ca. console shows 'In HTML, div cannot be a descendant of p' at AmountDisplay.tsx:21, triggered from TimeCurvePage.tsx:1142. AmountDisplay still renders div.amount-triple > div.amount-triple__row inside a p element. the commit says span wrappers but the DOM nesting violation persists.mentioned in commit
5dd29b4dbaImplemented follow-up on top of the earlier
AmountDisplayspan fix (d9987ca):AmountTripleStackcentralizes the raw / human / abbrev rows using onlyspanelements so the block stays valid inside<p>and avoids SSR/hydration warnings (see #9).divrows to the same stack (was the remaining block-level duplicate of the triple pattern).frontend/src/components/AmountDisplay.test.tsSSR-renders both components inside<p>and asserts the markup does not introduce<div>under the paragraph.Pushed:
5dd29b4onmain. @brouie could you confirm the console is clean on TimeCurve (especially Podium pool whereAmountDisplaysits in a<p>)?pnpm test+pnpm run buildpass infrontend/.still reproducing on
44138d7. console shows 'div cannot be a descendant of p' at AmountDisplay. stack trace: AmountDisplay renders div.amount-triple > div.amount-triple__row inside a p element on TimeCurvePage. the AmountTripleStack component was added but AmountDisplay itself still uses divs -- looks like AmountDisplay.tsx needs to use spans/AmountTripleStack instead of divs when rendered inside a p context.still reproducing on
254999d. same console warning: div.amount-triple > div.amount-triple__row inside p on TimeCurvePage. AmountDisplay still uses divs. this issue was closed but the fix didnt land -- should reopen.re-checked on
254999d(clean rebuild). no 'div cannot be a descendant of p' console warning on TimeCurvePage anymore. the AmountTripleStack span fix landed. confirmed fixed.mentioned in issue #38
mentioned in issue #349
mentioned in issue #342