fix render blocking for chat/channel

This commit is contained in:
Ren Amamiya
2023-04-24 10:17:44 +07:00
parent 4bcecbfcf1
commit 80f1982c3e
4 changed files with 24 additions and 29 deletions

View File

@@ -7,7 +7,7 @@ import { useCallback, useRef } from 'react';
import Skeleton from 'react-loading-skeleton';
import { Virtuoso } from 'react-virtuoso';
export const ChannelMessages = () => {
export default function ChannelMessages() {
const virtuosoRef = useRef(null);
const data = useAtomValue(sortedChannelMessagesAtom);
@@ -42,7 +42,7 @@ export const ChannelMessages = () => {
/>
</div>
);
};
}
const COMPONENTS = {
EmptyPlaceholder: () => <Skeleton />,

View File

@@ -8,7 +8,7 @@ import { useCallback, useRef } from 'react';
import Skeleton from 'react-loading-skeleton';
import { Virtuoso } from 'react-virtuoso';
export const MessageList = () => {
export default function MessageList() {
const virtuosoRef = useRef(null);
const data = useAtomValue(sortedChatMessagesAtom);
@@ -47,7 +47,7 @@ export const MessageList = () => {
/>
</div>
);
};
}
const COMPONENTS = {
EmptyPlaceholder: () => <Skeleton />,