File tree 3 files changed +14
-6
lines changed
client/packages/lowcoder-design/src/components
3 files changed +14
-6
lines changed Original file line number Diff line number Diff line change 1
1
import { CSSProperties } from "react" ;
2
- import { Ref } from "react" ;
3
- import ReactPlayer from "react-player" ;
2
+ import { lazy , Ref } from "react" ;
3
+ import type { default as ReactPlayerType } from "react-player" ;
4
4
import styled from "styled-components" ;
5
5
6
+ const ReactPlayer = lazy ( ( ) => import ( "react-player" ) ) ;
7
+
6
8
const Audio = styled ( ReactPlayer ) `
7
9
height: 32px !important;
8
10
` ;
@@ -14,7 +16,7 @@ export function TacoAudio(props: {
14
16
onEnded ?: ( ) => void ;
15
17
className ?: string ;
16
18
style ?: CSSProperties ;
17
- audioRef ?: Ref < ReactPlayer > ;
19
+ audioRef ?: Ref < ReactPlayerType > ;
18
20
autoPlay ?: boolean ;
19
21
loop ?: boolean ;
20
22
} ) {
Original file line number Diff line number Diff line change 1
1
import { css } from "styled-components" ;
2
- import ReactMarkdown from "react-markdown" ;
2
+ import { lazy } from "react" ;
3
+ // import ReactMarkdown from "react-markdown";
3
4
import rehypeRaw from "rehype-raw" ;
4
5
import rehypeSanitize , { defaultSchema } from "rehype-sanitize" ;
5
6
import remarkGfm from "remark-gfm" ;
6
- import { ReactMarkdownOptions } from "react-markdown/lib/react-markdown" ;
7
+ import type { ReactMarkdownOptions } from "react-markdown/lib/react-markdown" ;
8
+
9
+ const ReactMarkdown = lazy ( ( ) => import ( 'react-markdown' ) ) ;
7
10
8
11
export const markdownCompCss = css `
9
12
.markdown-body {
Original file line number Diff line number Diff line change 1
- import ReactPlayer from "react-player" ;
1
+ // import ReactPlayer from "react-player";
2
+ import { lazy } from 'react' ;
2
3
import styled from "styled-components" ;
3
4
import { videoPlayTriangle } from "icons" ;
4
5
6
+ const ReactPlayer = lazy ( ( ) => import ( "react-player" ) ) ;
7
+
5
8
export const Video = styled ( ReactPlayer ) `
6
9
height: 100% !important;
7
10
width: 100% !important;
You can’t perform that action at this time.
0 commit comments