File tree Expand file tree Collapse file tree 2 files changed +22
-12
lines changed Expand file tree Collapse file tree 2 files changed +22
-12
lines changed Original file line number Diff line number Diff line change @@ -1519,7 +1519,7 @@ describe("<DataMemoryRouter>", () => {
1519
1519
expect ( getHtml ( container ) ) . toMatchInlineSnapshot ( `
1520
1520
"<div>
1521
1521
<h2>
1522
- Unhandled Thrown Error!
1522
+ Unexpected Application Error!
1523
1523
</h2>
1524
1524
<h3
1525
1525
style="font-style: italic;"
@@ -1629,7 +1629,7 @@ describe("<DataMemoryRouter>", () => {
1629
1629
expect ( getHtml ( container ) ) . toMatchInlineSnapshot ( `
1630
1630
"<div>
1631
1631
<h2>
1632
- Unhandled Thrown Error!
1632
+ Unexpected Application Error!
1633
1633
</h2>
1634
1634
<h3
1635
1635
style="font-style: italic;"
@@ -1874,7 +1874,7 @@ describe("<DataMemoryRouter>", () => {
1874
1874
expect ( getHtml ( container ) ) . toMatchInlineSnapshot ( `
1875
1875
"<div>
1876
1876
<h2>
1877
- Unhandled Thrown Error!
1877
+ Unexpected Application Error!
1878
1878
</h2>
1879
1879
<h3
1880
1880
style="font-style: italic;"
@@ -2058,7 +2058,7 @@ describe("<DataMemoryRouter>", () => {
2058
2058
"<div>
2059
2059
<div>
2060
2060
<h2>
2061
- Unhandled Thrown Error!
2061
+ Unexpected Application Error!
2062
2062
</h2>
2063
2063
<h3
2064
2064
style="font-style: italic;"
Original file line number Diff line number Diff line change @@ -463,18 +463,28 @@ function DefaultErrorElement() {
463
463
let lightgrey = "rgba(200,200,200, 0.5)" ;
464
464
let preStyles = { padding : "0.5rem" , backgroundColor : lightgrey } ;
465
465
let codeStyles = { padding : "2px 4px" , backgroundColor : lightgrey } ;
466
+
467
+ let devInfo = null ;
468
+ if ( __DEV__ ) {
469
+ devInfo = (
470
+ < >
471
+ < p > 💿 Hey developer 👋</ p >
472
+ < p >
473
+ You can provide a way better UX than this when your app throws errors
474
+ by providing your own
475
+ < code style = { codeStyles } > errorElement</ code > props on
476
+ < code style = { codeStyles } > <Route></ code >
477
+ </ p >
478
+ </ >
479
+ ) ;
480
+ }
481
+
466
482
return (
467
483
< >
468
- < h2 > Unhandled Thrown Error!</ h2 >
484
+ < h2 > Unexpected Application Error!</ h2 >
469
485
< h3 style = { { fontStyle : "italic" } } > { message } </ h3 >
470
486
{ stack ? < pre style = { preStyles } > { stack } </ pre > : null }
471
- < p > 💿 Hey developer 👋</ p >
472
- < p >
473
- You can provide a way better UX than this when your app throws errors by
474
- providing your own
475
- < code style = { codeStyles } > errorElement</ code > props on
476
- < code style = { codeStyles } > <Route></ code >
477
- </ p >
487
+ { devInfo }
478
488
</ >
479
489
) ;
480
490
}
You can’t perform that action at this time.
0 commit comments