Skip to content

Commit 5dee34a

Browse files
Use > as a marker for attention
Co-authored-by: tjallingt <[email protected]>
1 parent b409317 commit 5dee34a

File tree

5 files changed

+29
-29
lines changed

5 files changed

+29
-29
lines changed

packages/react-dom-bindings/src/client/validateDOMNesting.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function describeAncestors(
5151
if (node !== null) {
5252
// Describe the node using the hydration diff logic.
5353
// Replace + with - to mark ancestor and child. It's kind of arbitrary.
54-
return describeDiff(node).replace(/\n\+/g, '\n-');
54+
return describeDiff(node).replaceAll(/^[+-]/gm, '>');
5555
}
5656
return '';
5757
}

packages/react-dom/src/__tests__/ReactDOMComponent-test.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2197,8 +2197,8 @@ describe('ReactDOMComponent', () => {
21972197
'In HTML, <tr> cannot be a child of <div>.\n' +
21982198
'This will cause a hydration error.\n' +
21992199
'\n' +
2200-
'- <div>\n' +
2201-
'- <tr>\n' +
2200+
'> <div>\n' +
2201+
'> <tr>\n' +
22022202
' ...\n' +
22032203
'\n in tr (at **)' +
22042204
(gate(flags => flags.enableOwnerStacks)
@@ -2263,9 +2263,9 @@ describe('ReactDOMComponent', () => {
22632263
'This will cause a hydration error.\n' +
22642264
'\n' +
22652265
' <Foo>\n' +
2266-
'- <table>\n' +
2266+
'> <table>\n' +
22672267
' <Row>\n' +
2268-
'- <tr>\n' +
2268+
'> <tr>\n' +
22692269
' ...\n' +
22702270
'\n in tr (at **)' +
22712271
'\n in Row (at **)',
@@ -2280,7 +2280,7 @@ describe('ReactDOMComponent', () => {
22802280
' <table>\n' +
22812281
' <Row>\n' +
22822282
' <tr>\n' +
2283-
'- x\n' +
2283+
'> x\n' +
22842284
' ...\n' +
22852285
'\n in tr (at **)' +
22862286
'\n in Row (at **)',
@@ -2290,9 +2290,9 @@ describe('ReactDOMComponent', () => {
22902290
'This will cause a hydration error.\n' +
22912291
'\n' +
22922292
' <Foo>\n' +
2293-
'- <table>\n' +
2293+
'> <table>\n' +
22942294
' <Row>\n' +
2295-
'- {" "}\n' +
2295+
'> {" "}\n' +
22962296
'\n in table (at **)' +
22972297
'\n in Foo (at **)',
22982298
]
@@ -2303,9 +2303,9 @@ describe('ReactDOMComponent', () => {
23032303
'This will cause a hydration error.\n' +
23042304
'\n' +
23052305
' <Foo>\n' +
2306-
'- <table>\n' +
2306+
'> <table>\n' +
23072307
' <Row>\n' +
2308-
'- <tr>\n' +
2308+
'> <tr>\n' +
23092309
' ...\n' +
23102310
'\n in tr (at **)' +
23112311
'\n in Row (at **)' +
@@ -2319,7 +2319,7 @@ describe('ReactDOMComponent', () => {
23192319
' <table>\n' +
23202320
' <Row>\n' +
23212321
' <tr>\n' +
2322-
'- x\n' +
2322+
'> x\n' +
23232323
' ...\n' +
23242324
'\n in tr (at **)' +
23252325
'\n in Row (at **)' +
@@ -2331,9 +2331,9 @@ describe('ReactDOMComponent', () => {
23312331
'This will cause a hydration error.\n' +
23322332
'\n' +
23332333
' <Foo>\n' +
2334-
'- <table>\n' +
2334+
'> <table>\n' +
23352335
' <Row>\n' +
2336-
'- {" "}\n' +
2336+
'> {" "}\n' +
23372337
'\n in table (at **)' +
23382338
'\n in Foo (at **)',
23392339
],
@@ -2368,7 +2368,7 @@ describe('ReactDOMComponent', () => {
23682368
'\n' +
23692369
' <Foo>\n' +
23702370
' <table>\n' +
2371-
'- {" "}\n' +
2371+
'> {" "}\n' +
23722372
'\n in table (at **)' +
23732373
'\n in Foo (at **)',
23742374
]);
@@ -2403,7 +2403,7 @@ describe('ReactDOMComponent', () => {
24032403
' <tbody>\n' +
24042404
' <Row>\n' +
24052405
' <tr>\n' +
2406-
'- text\n' +
2406+
'> text\n' +
24072407
'\n in tr (at **)' +
24082408
'\n in Row (at **)' +
24092409
(gate(flags => flags.enableOwnerStacks)

packages/react-dom/src/__tests__/ReactDOMForm-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,9 +389,9 @@ describe('ReactDOMForm', () => {
389389
'In HTML, <form> cannot be a descendant of <form>.\n' +
390390
'This will cause a hydration error.\n' +
391391
'\n' +
392-
'- <form action={function outerAction}>\n' +
392+
'> <form action={function outerAction}>\n' +
393393
' <input>\n' +
394-
'- <form action={function innerAction} ref={{current:null}}>\n' +
394+
'> <form action={function innerAction} ref={{current:null}}>\n' +
395395
'\n in form (at **)' +
396396
(gate(flags => flags.enableOwnerStacks) ? '' : '\n in form (at **)'),
397397
);

packages/react-dom/src/__tests__/ReactDOMOption-test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ describe('ReactDOMOption', () => {
5454
'In HTML, <div> cannot be a child of <option>.\n' +
5555
'This will cause a hydration error.\n' +
5656
'\n' +
57-
'- <option value="12">\n' +
58-
'- <div>\n' +
57+
'> <option value="12">\n' +
58+
'> <div>\n' +
5959
' ...\n' +
6060
'\n' +
6161
' in div (at **)' +
@@ -278,8 +278,8 @@ describe('ReactDOMOption', () => {
278278
'This will cause a hydration error.\n' +
279279
'\n' +
280280
' <select readOnly={true} value="bar">\n' +
281-
'- <option value="bar">\n' +
282-
'- <div ref={{current:null}}>\n' +
281+
'> <option value="bar">\n' +
282+
'> <div ref={{current:null}}>\n' +
283283
' ...\n' +
284284
'\n' +
285285
' in div (at **)' +

packages/react-dom/src/__tests__/validateDOMNesting-test.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ describe('validateDOMNesting', () => {
9999
'This will cause a hydration error.\n' +
100100
'\n' +
101101
' <ul>\n' +
102-
'- <li>\n' +
102+
'> <li>\n' +
103103
' <div>\n' +
104-
'- <li>\n' +
104+
'> <li>\n' +
105105
'\n' +
106106
' in li (at **)',
107107
'<li> cannot contain a nested <li>.\nSee this log for the ancestor stack trace.\n' +
@@ -112,9 +112,9 @@ describe('validateDOMNesting', () => {
112112
'This will cause a hydration error.\n' +
113113
'\n' +
114114
' <ul>\n' +
115-
'- <li>\n' +
115+
'> <li>\n' +
116116
' <div>\n' +
117-
'- <li>\n' +
117+
'> <li>\n' +
118118
'\n' +
119119
' in li (at **)\n' +
120120
' in div (at **)\n' +
@@ -146,8 +146,8 @@ describe('validateDOMNesting', () => {
146146
'In HTML, <body> cannot be a child of <foreignObject>.\n' +
147147
'This will cause a hydration error.\n' +
148148
'\n' +
149-
'- <foreignObject>\n' +
150-
'- <body>\n' +
149+
'> <foreignObject>\n' +
150+
'> <body>\n' +
151151
'\n' +
152152
' in body (at **)',
153153
'You are mounting a new body component when a previous one has not first unmounted. It is an error to render more than one body component at a time and attributes and children of these components will likely fail in unpredictable ways. Please only render a single instance of <body> and if you need to mount a new one, ensure any previous ones have unmounted first.\n' +
@@ -158,8 +158,8 @@ describe('validateDOMNesting', () => {
158158
'In HTML, <body> cannot be a child of <foreignObject>.\n' +
159159
'This will cause a hydration error.\n' +
160160
'\n' +
161-
'- <foreignObject>\n' +
162-
'- <body>\n' +
161+
'> <foreignObject>\n' +
162+
'> <body>\n' +
163163
'\n' +
164164
' in body (at **)\n' +
165165
' in foreignObject (at **)',

0 commit comments

Comments
 (0)