Is your feature request related to a problem? Please describe.
If there is a connection error when initiating the ChatkitProvider HOC, there is no way to catch the error (that I know of). For example, the following code throws and error in the console but the error can't be caught in a functional component so no error can be shown to the user:
Describe the solution you'd like
I would like a hook, event like .onInitError(), or ability to pass in an onInitError() callback to the ChatkitProvider.
Describe alternatives you've considered
I could presumably handle the error inside a child component when accessing the chatkit instance but this will be ineffective when my HOC contains several child components, which is the case in my app, like <ChatContacts /><ChatMessages /><ChatInput />. In this case, handling the error message in any of these components would result in either 1) the two other components rendered or visible or 2) a convoluted process of passing the error back to the parent HOC Chatkit component.
Additional context
Add any other context or screenshots about the feature request here.
Is your feature request related to a problem? Please describe. If there is a connection error when initiating the
ChatkitProvider
HOC, there is no way to catch the error (that I know of). For example, the following code throws and error in the console but the error can't be caught in a functional component so no error can be shown to the user:Describe the solution you'd like I would like a hook, event like
.onInitError()
, or ability to pass in anonInitError()
callback to the ChatkitProvider.Describe alternatives you've considered I could presumably handle the error inside a child component when accessing the
chatkit
instance but this will be ineffective when my HOC contains several child components, which is the case in my app, like<ChatContacts /><ChatMessages /><ChatInput />
. In this case, handling the error message in any of these components would result in either 1) the two other components rendered or visible or 2) a convoluted process of passing the error back to the parent HOC Chatkit component.Additional context Add any other context or screenshots about the feature request here.