Commit 050be89
authored
[v3.1.2] (Aug 31 2022) (#278)
Migrate UI components into TypeScript
This doesnt affect anyone, it a step in task to migrate the project source code into TS
Fixes:
* Type defn: Change type of react elements to `React.ReactElement`
* Change every `React.ReactNode` and `React.Component` to `React.ReactElement`
* Use the type of SendbirdError
* Use the type MessageSearchQueryParams
* Use enum MessageSearchOrder.TIMESTAMP in the message search query params instead of `'ts' as const`
**ReactNode** could be `string | number | null | undefined | ReactElement | portal` and this(expecting string or number) causes **warning** when we use it like `<CustomComp />`
```typescript
// in the component
{ renderMessage } = props
const CustomMessage = useMemo(() => {
return renderMessage({ ... });
}, []);
return (
<div>
<CustomMessage />
</div>
);
```
so expecting **ReactElement** is better for our case
* Fix message grouping:
Set isMessageGroupingEnabed to true(was set to false during v2 migration)
https://sendbird.atlassian.net/browse/SDKRLSD-4661 parent d5f9305 commit 050be89
3 files changed
+32
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
3 | 32 | | |
4 | 33 | | |
5 | 34 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
0 commit comments