Skip to content

Commit 40adbbb

Browse files
richadrRobbert
authored andcommitted
fix: avoid rendering html/body tags in stories
1 parent f861665 commit 40adbbb

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

packages/storybook-css/src/Body.stories.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ type Story = StoryObj<typeof meta>;
4646

4747
export const Default: Story = {
4848
args: {
49+
Component: 'div', // React 19 can no longer render html/body tags without erroring
4950
children: [<Paragraph>Body content</Paragraph>],
5051
},
5152
};

packages/storybook-css/src/Document.stories.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export const Default: Story = {
9696
export const Language: Story = {
9797
args: {
9898
children: 'English',
99-
element: 'html',
99+
element: 'div',
100100
lang: 'en',
101101
},
102102
name: 'Language',
@@ -112,7 +112,7 @@ export const Language: Story = {
112112
export const Nederlands: Story = {
113113
args: {
114114
children: 'Nederlands',
115-
element: 'html',
115+
element: 'div',
116116
lang: 'nl',
117117
},
118118
name: 'Nederlands',
@@ -128,7 +128,7 @@ export const Nederlands: Story = {
128128
export const Fries: Story = {
129129
args: {
130130
children: 'Frysk',
131-
element: 'html',
131+
element: 'div',
132132
lang: 'fy',
133133
},
134134
name: 'Fries',
@@ -144,7 +144,7 @@ export const Fries: Story = {
144144
export const Drents: Story = {
145145
args: {
146146
children: 'Drèents',
147-
element: 'html',
147+
element: 'div',
148148
lang: 'drt',
149149
},
150150
name: 'Drents',
@@ -160,7 +160,7 @@ export const Drents: Story = {
160160
export const Limburgs: Story = {
161161
args: {
162162
children: 'Limburgs (ouch waal: Lèmburgs)',
163-
element: 'html',
163+
element: 'div',
164164
lang: 'li',
165165
},
166166
name: 'Limburgs',
@@ -176,7 +176,7 @@ export const Limburgs: Story = {
176176
export const Zeeuws: Story = {
177177
args: {
178178
children: 'Zeêuws',
179-
element: 'html',
179+
element: 'div',
180180
lang: 'zea',
181181
},
182182
name: 'Zeeuws',
@@ -192,7 +192,7 @@ export const Zeeuws: Story = {
192192
export const Twents: Story = {
193193
args: {
194194
children: 'Twents',
195-
element: 'html',
195+
element: 'div',
196196
lang: 'twd',
197197
},
198198
name: 'Twents',
@@ -208,7 +208,7 @@ export const Twents: Story = {
208208
export const Papiamento: Story = {
209209
args: {
210210
children: 'Papiamento',
211-
element: 'html',
211+
element: 'div',
212212
lang: 'pap',
213213
},
214214
name: 'Papiamento',

packages/storybook-css/src/Root.stories.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ type Story = StoryObj<typeof meta>;
4545

4646
export const Default: Story = {
4747
args: {
48+
Component: 'div', // React 19 can no longer render html/body tags without erroring
4849
children: [
49-
<Body>
50+
<Body Component="div">
5051
<Paragraph>Root content</Paragraph>
5152
</Body>,
5253
],

0 commit comments

Comments
 (0)