Skip to content

Commit b42668b

Browse files
author
Sravan S
authored
hotfix: TSC error in typescript sample (#597)
SendbirdProvider should have only one child Thanks @msell Fixes: #540
1 parent 629c611 commit b42668b

File tree

1 file changed

+26
-26
lines changed
  • samples/typescript_sample/src

1 file changed

+26
-26
lines changed
Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
1-
import './App.css';
2-
import '@sendbird/uikit-react/dist/index.css';
1+
import './App.css'
2+
import '@sendbird/uikit-react/dist/index.css'
33

4-
import React from 'react';
4+
import React from 'react'
55

6-
import SendbirdProvider from '@sendbird/uikit-react/SendbirdProvider';
7-
import ChannelList from '@sendbird/uikit-react/ChannelList';
8-
import Channel from '@sendbird/uikit-react/Channel';
6+
import SendbirdProvider from '@sendbird/uikit-react/SendbirdProvider'
7+
import ChannelList from '@sendbird/uikit-react/ChannelList'
8+
import Channel from '@sendbird/uikit-react/Channel'
99

10-
import { APP_ID, USER_ID, NICKNAME } from './const';
10+
import { APP_ID, USER_ID, NICKNAME } from './const'
1111

1212
function App() {
13-
const [currentChannelUrl, setCurrentChannelUrl] = React.useState('');
13+
const [currentChannelUrl, setCurrentChannelUrl] = React.useState('')
1414
return (
1515
<div className="App">
1616
<SendbirdProvider appId={APP_ID} userId={USER_ID} nickname={NICKNAME}>
17-
<div className="sendbird-app__channellist-wrap">
18-
{/* ChannelList has wrong props will fix in 2.0.1
19-
// @ts-ignore */}
20-
<ChannelList
21-
onChannelSelect={(channel) => {
22-
if (channel?.url) {
23-
setCurrentChannelUrl(channel.url);
24-
}
25-
}}
26-
/>
27-
</div>
28-
<div className="sendbird-app__conversation-wrap">
29-
<Channel
30-
channelUrl={currentChannelUrl}
31-
/>
32-
</div>
17+
<>
18+
<div className="sendbird-app__channellist-wrap">
19+
<ChannelList
20+
onChannelSelect={(channel) => {
21+
if (channel?.url) {
22+
setCurrentChannelUrl(channel.url)
23+
}
24+
}}
25+
/>
26+
</div>
27+
<div className="sendbird-app__conversation-wrap">
28+
<Channel
29+
channelUrl={currentChannelUrl}
30+
/>
31+
</div>
32+
</>
3333
</SendbirdProvider>
3434
</div>
35-
);
35+
)
3636
}
3737

38-
export default App;
38+
export default App

0 commit comments

Comments
 (0)