-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DevOverlay] Hydration Error Code Frame (#74822)
This PR added Hydration Error Code Frame. ### Light https://github.com/user-attachments/assets/1e44cf6b-f3f3-498d-a771-876282d485b3 ### Dark https://github.com/user-attachments/assets/1098cb51-54ff-4bec-a12b-27d09b469be9 Closes NDX-611
- Loading branch information
1 parent
23dee53
commit b0c14f6
Showing
3 changed files
with
163 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
...lay/_experimental/internal/container/RuntimeError/component-stack-pseudo-html.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import type { Meta, StoryObj } from '@storybook/react' | ||
import { PseudoHtmlDiff } from './component-stack-pseudo-html' | ||
import { withShadowPortal } from '../../storybook/with-shadow-portal' | ||
|
||
const meta: Meta<typeof PseudoHtmlDiff> = { | ||
component: PseudoHtmlDiff, | ||
parameters: { | ||
layout: 'fullscreen', | ||
}, | ||
decorators: [withShadowPortal], | ||
} | ||
|
||
export default meta | ||
type Story = StoryObj<typeof PseudoHtmlDiff> | ||
|
||
const sampleComponentStack = [ | ||
{ | ||
component: 'div', | ||
canOpenInEditor: false, | ||
}, | ||
{ | ||
component: 'article', | ||
canOpenInEditor: false, | ||
}, | ||
{ | ||
component: 'main', | ||
canOpenInEditor: false, | ||
}, | ||
{ | ||
component: 'Home', | ||
canOpenInEditor: false, | ||
}, | ||
] | ||
|
||
export const TextMismatch: Story = { | ||
args: { | ||
componentStackFrames: sampleComponentStack, | ||
firstContent: 'Server rendered content', | ||
secondContent: 'Client rendered content', | ||
hydrationMismatchType: 'text', | ||
reactOutputComponentDiff: undefined, | ||
}, | ||
} | ||
|
||
export const TextInTagMismatch: Story = { | ||
args: { | ||
componentStackFrames: sampleComponentStack, | ||
firstContent: 'Mismatched content', | ||
secondContent: 'p', | ||
hydrationMismatchType: 'text-in-tag', | ||
reactOutputComponentDiff: undefined, | ||
}, | ||
} | ||
|
||
export const ReactUnifiedMismatch: Story = { | ||
args: { | ||
componentStackFrames: sampleComponentStack, | ||
hydrationMismatchType: 'tag', | ||
reactOutputComponentDiff: `<Page> | ||
<Layout> | ||
<div> | ||
- <p>Server content</p> | ||
+ <p>Client content</p>`, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters