React Native/Expo shows white screen while loading Chatbox/ConversationList
luukvanettinger opened this issue · 3 comments
So I followed the react-native example in my project with the @talkjs/expo
package. Everything works well except the following:
When loading the Chatbox or ConversationList component, the webview shows a white screen for a second before the chats are loaded. This does not look good as the theme of my app has a dark/black background. I can't change the styling of this in the talkjs dashboard nor can I do any style changes in my own code.
What I would like to do is show a loadingScreen with loading indicator (and dark bg) until the Chatbox/ConversationList component is loaded. In react-native-webview
package there is a prop called renderLoading
that can be used for this. Could it be possible to add this prop to the Chatbox/ConversationList components? I see this has been suggested before => #288 (comment)
Or is there another way for me to work around this? Below is a code snippet of how I got it working as of now in my project for the Chatbox component.
export interface ChatBoxScreenProps {
me: TalkRn.User;
conversationId: TalkRn.ConversationBuilder | string;
}
const ChatBoxScreen = (props: ChatBoxScreenProps) => {
const {me, conversationId} = props;
const {user} = useAuth();
const conversationBuilder = TalkRn.getConversationBuilder(
conversationId as string,
);
conversationBuilder.setParticipant(me);
return (
user &&
<TalkRn.Session appId='_app_id_' me={me} signature={user.talkjsSignature}>
<TalkRn.Chatbox
theme="default_mobile"
conversationBuilder={conversationBuilder}
/>
</TalkRn.Session>
);
};
export default ChatBoxScreen;
Hey there, I'm a developer here at TalkJS. I'm currently working on releasing the next update of the React Native SDK. It is in its final stages and should be releasing soon. This update will provide a prop loadingComponent
through which you can provide a React component that will be displayed while loading. Until that update has been released, I don't think there's a workaround for this.
Sounds perfect, looking forward to the next update. Thanks for the reply!