File tree Expand file tree Collapse file tree 2 files changed +23
-14
lines changed
next-devtools/userspace/app Expand file tree Collapse file tree 2 files changed +23
-14
lines changed Original file line number Diff line number Diff line change @@ -615,6 +615,14 @@ export default function OuterLayoutRouter({
615
615
? RenderChildren
616
616
: ErrorBoundary
617
617
618
+ let segmentBoundaryTriggerNode : React . ReactNode = null
619
+ if ( process . env . NODE_ENV !== 'production' ) {
620
+ const { SegmentBoundaryTriggerNode } =
621
+ require ( '../../next-devtools/userspace/app/segment-explorer-node' ) as typeof import ( '../../next-devtools/userspace/app/segment-explorer-node' )
622
+
623
+ segmentBoundaryTriggerNode = < SegmentBoundaryTriggerNode />
624
+ }
625
+
618
626
// TODO: The loading module data for a segment is stored on the parent, then
619
627
// applied to each of that parent segment's parallel route slots. In the
620
628
// simple case where there's only one parallel route (the `children` slot),
@@ -641,6 +649,7 @@ export default function OuterLayoutRouter({
641
649
unauthorized = { unauthorized }
642
650
>
643
651
< RedirectBoundary >
652
+ { segmentBoundaryTriggerNode }
644
653
< InnerLayoutRouter
645
654
url = { url }
646
655
tree = { tree }
Original file line number Diff line number Diff line change @@ -76,6 +76,19 @@ export function SegmentViewStateNode({ page }: { page: string }) {
76
76
return null
77
77
}
78
78
79
+ export function SegmentBoundaryTriggerNode ( ) {
80
+ const { boundaryType } = useSegmentState ( )
81
+ let segmentNode : React . ReactNode = null
82
+ if ( boundaryType === 'loading' ) {
83
+ segmentNode = < LoadingSegmentNode />
84
+ } else if ( boundaryType === 'not-found' ) {
85
+ segmentNode = < NotFoundSegmentNode />
86
+ } else if ( boundaryType === 'error' ) {
87
+ segmentNode = < ErrorSegmentNode />
88
+ }
89
+ return segmentNode
90
+ }
91
+
79
92
export function SegmentViewNode ( {
80
93
type,
81
94
pagePath,
@@ -85,22 +98,9 @@ export function SegmentViewNode({
85
98
pagePath : string
86
99
children ?: ReactNode
87
100
} ) : React . ReactNode {
88
- const { boundaryType } = useSegmentState ( )
89
-
90
- const isChildBoundary = type !== 'layout' && type !== 'template'
91
-
92
- let segmentNode = (
101
+ const segmentNode = (
93
102
< SegmentTrieNode key = { type } type = { type } pagePath = { pagePath } />
94
103
)
95
- if ( boundaryType && boundaryType !== type && isChildBoundary ) {
96
- if ( boundaryType === 'loading' ) {
97
- segmentNode = < LoadingSegmentNode />
98
- } else if ( boundaryType === 'not-found' ) {
99
- segmentNode = < NotFoundSegmentNode />
100
- } else if ( boundaryType === 'error' ) {
101
- segmentNode = < ErrorSegmentNode />
102
- }
103
- }
104
104
105
105
return (
106
106
< >
You can’t perform that action at this time.
0 commit comments