File tree 1 file changed +9
-7
lines changed
site/src/components/IconField 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -113,19 +113,21 @@ export const IconField: FC<IconFieldProps> = ({
113
113
) }
114
114
</ Popover >
115
115
116
- { /* This component takes a long time to load (easily several seconds), so we
116
+ { /*
117
+ - This component takes a long time to load (easily several seconds), so we
117
118
don't want to wait until the user actually clicks the button to start loading.
118
119
Unfortunately, React doesn't provide an API to start warming a lazy component,
119
120
so we just have to sneak it into the DOM, which is kind of annoying, but means
120
- that users shouldn't ever spend time waiting for it to load. */ }
121
- < div css = { { ...visuallyHidden } } >
122
- { /* `ErrorBoundary` is for tests, this component requires `IntersectionObserver` */ }
123
- < ErrorBoundary fallback = { null } >
121
+ that users shouldn't ever spend time waiting for it to load.
122
+ - Except we don't do it when running tests, because Jest doesn't define
123
+ `IntersectionObserver`, and it would make them slower anyway. */ }
124
+ { process . env . NODE_ENV !== "test" && (
125
+ < div css = { { ...visuallyHidden } } >
124
126
< Suspense >
125
127
< EmojiPicker onEmojiSelect = { ( ) => { } } />
126
128
</ Suspense >
127
- </ ErrorBoundary >
128
- </ div >
129
+ </ div >
130
+ ) }
129
131
</ Stack >
130
132
) ;
131
133
} ;
You can’t perform that action at this time.
0 commit comments