Lazy load some components that aren't needed at load. For #2167

This commit is contained in:
Gabe Kangas
2022-10-03 21:06:46 -07:00
parent 4a999a39b2
commit b1484f4c9f
4 changed files with 51 additions and 11 deletions

View File

@ -4,12 +4,16 @@ import React, { FC, useMemo, useState } from 'react';
import { useRecoilValue } from 'recoil';
import { Transforms, createEditor, BaseEditor, Text, Descendant, Editor, Node, Path } from 'slate';
import { Slate, Editable, withReact, ReactEditor, useSelected, useFocused } from 'slate-react';
import { EmojiPicker } from './EmojiPicker';
import dynamic from 'next/dynamic';
import WebsocketService from '../../../services/websocket-service';
import { websocketServiceAtom } from '../../stores/ClientConfigStore';
import { MessageType } from '../../../interfaces/socket-events';
import styles from './ChatTextField.module.scss';
// Lazy loaded components
const EmojiPicker = dynamic(() => import('./EmojiPicker').then(mod => mod.EmojiPicker));
type CustomElement = { type: 'paragraph' | 'span'; children: CustomText[] } | ImageNode;
type CustomText = { text: string };