Skip to content

Commit

Permalink
chore: formatted code in getting-started.mdx
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverlaz committed Jul 25, 2023
1 parent 21879ea commit a24755d
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions docusaurus/docs/React/basics/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,10 @@ const options = { state: true, presence: true, limit: 10 };
const sort = { last_message_at: -1 };

const App = () => {
const [client, setClient] = useState(null);
const [client, setClient] = useState(null);

useEffect(() => {
const newClient = new StreamChat('your_api_key');
useEffect(() => {
const newClient = new StreamChat('your_api_key');

const handleConnectionChange = ({ online = false }) => {
if (!online) return console.log('connection lost');
Expand All @@ -224,23 +224,23 @@ const newClient = new StreamChat('your_api_key');
newClient.off('connection.changed', handleConnectionChange);
newClient.disconnectUser().then(() => console.log('connection closed'));
};
}, []);

if (!client) return null;

return (
<Chat client={client}>
<ChannelList filters={filters} sort={sort} options={options} />
<Channel>
<Window>
<ChannelHeader />
<MessageList />
<MessageInput />
</Window>
<Thread />
</Channel>
</Chat>
);
}, []);

if (!client) return null;

return (
<Chat client={client}>
<ChannelList filters={filters} sort={sort} options={options} />
<Channel>
<Window>
<ChannelHeader />
<MessageList />
<MessageInput />
</Window>
<Thread />
</Channel>
</Chat>
);
};

export default App;
Expand Down

0 comments on commit a24755d

Please sign in to comment.