Skip to content

Instantly share code, notes, and snippets.

@adelowo

adelowo/Chat.js Secret

Created April 22, 2020 09:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adelowo/41a13facd905601f63fb3c44ae1be26c to your computer and use it in GitHub Desktop.
Save adelowo/41a13facd905601f63fb3c44ae1be26c to your computer and use it in GitHub Desktop.
import React, {Component} from 'react';
import {View} from 'react-native';
import {
Chat,
Channel,
MessageList,
MessageInput,
} from 'stream-chat-react-native';
export default class ChatView extends Component {
render() {
const channel = this.props.chatClient.channel('messaging', 'rails-chat');
channel.watch();
return (
<Chat client={this.props.chatClient}>
<Channel channel={channel}>
<View style={{display: 'flex', height: '100%'}}>
<MessageList />
<MessageInput />
</View>
</Channel>
</Chat>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment