@@ -86,6 +86,7 @@ export type SendbirdUIKitContainerProps = React.PropsWithChildren<{
86
86
HeaderComponent ?: HeaderStyleContextType [ 'HeaderComponent' ] ;
87
87
} ;
88
88
errorBoundary ?: {
89
+ disabled ?: boolean ;
89
90
onError ?: ( props : ErrorBoundaryProps ) => void ;
90
91
ErrorInfoComponent ?: ( props : ErrorBoundaryProps ) => JSX . Element ;
91
92
} ;
@@ -142,17 +143,20 @@ const SendbirdUIKitContainer = ({
142
143
trigger : MentionConfig . DEFAULT . TRIGGER ,
143
144
} ) ;
144
145
return new MentionManager ( config , chatOptions ?. enableUserMention ?? SendbirdUIKit . DEFAULT . USER_MENTION ) ;
145
- } , [ userMention ?. mentionLimit , userMention ?. suggestionLimit , userMention ?. debounceMills ] ) ;
146
+ } , [
147
+ chatOptions ?. enableUserMention ,
148
+ userMention ?. mentionLimit ,
149
+ userMention ?. suggestionLimit ,
150
+ userMention ?. debounceMills ,
151
+ ] ) ;
146
152
147
- const imageCompressionConfig = useMemo (
148
- ( ) =>
149
- new ImageCompressionConfig ( {
150
- compressionRate : imageCompression ?. compressionRate || ImageCompressionConfig . DEFAULT . COMPRESSION_RATE ,
151
- width : imageCompression ?. width ,
152
- height : imageCompression ?. height ,
153
- } ) ,
154
- [ imageCompression ?. compressionRate , imageCompression ?. width , imageCompression ?. height ] ,
155
- ) ;
153
+ const imageCompressionConfig = useMemo ( ( ) => {
154
+ return new ImageCompressionConfig ( {
155
+ compressionRate : imageCompression ?. compressionRate || ImageCompressionConfig . DEFAULT . COMPRESSION_RATE ,
156
+ width : imageCompression ?. width ,
157
+ height : imageCompression ?. height ,
158
+ } ) ;
159
+ } , [ imageCompression ?. compressionRate , imageCompression ?. width , imageCompression ?. height ] ) ;
156
160
157
161
useLayoutEffect ( ( ) => {
158
162
if ( ! isFirstMount ) {
@@ -172,6 +176,14 @@ const SendbirdUIKitContainer = ({
172
176
} ;
173
177
} , [ appId , internalStorage ] ) ;
174
178
179
+ const renderChildren = ( ) => {
180
+ if ( errorBoundary ?. disabled ) {
181
+ return children ;
182
+ } else {
183
+ return < InternalErrorBoundaryContainer { ...errorBoundary } > { children } </ InternalErrorBoundaryContainer > ;
184
+ }
185
+ } ;
186
+
175
187
return (
176
188
< SafeAreaProvider >
177
189
< SendbirdChatProvider
@@ -229,9 +241,7 @@ const SendbirdUIKitContainer = ({
229
241
} ,
230
242
} }
231
243
>
232
- < InternalErrorBoundaryContainer { ...errorBoundary } >
233
- { children }
234
- </ InternalErrorBoundaryContainer >
244
+ { renderChildren ( ) }
235
245
</ DialogProvider >
236
246
) ;
237
247
} }
0 commit comments