diff options
Diffstat (limited to 'packages/renderer/src/components/BrowserViewPlaceholder.tsx')
-rw-r--r-- | packages/renderer/src/components/BrowserViewPlaceholder.tsx | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/packages/renderer/src/components/BrowserViewPlaceholder.tsx b/packages/renderer/src/components/BrowserViewPlaceholder.tsx index c07ed15..1f5f9f4 100644 --- a/packages/renderer/src/components/BrowserViewPlaceholder.tsx +++ b/packages/renderer/src/components/BrowserViewPlaceholder.tsx | |||
@@ -20,12 +20,15 @@ | |||
20 | 20 | ||
21 | import Box from '@mui/material/Box'; | 21 | import Box from '@mui/material/Box'; |
22 | import throttle from 'lodash-es/throttle'; | 22 | import throttle from 'lodash-es/throttle'; |
23 | import { observer } from 'mobx-react-lite'; | 23 | import React, { ReactNode, useCallback, useRef } from 'react'; |
24 | import React, { useCallback, useRef } from 'react'; | ||
25 | 24 | ||
26 | import { useStore } from './StoreProvider'; | 25 | import { useStore } from './StoreProvider'; |
27 | 26 | ||
28 | export default observer(() => { | 27 | function BrowserViewPlaceholder({ |
28 | children, | ||
29 | }: { | ||
30 | children?: ReactNode; | ||
31 | }): JSX.Element { | ||
29 | const store = useStore(); | 32 | const store = useStore(); |
30 | 33 | ||
31 | // eslint-disable-next-line react-hooks/exhaustive-deps -- react-hooks doesn't support `throttle`. | 34 | // eslint-disable-next-line react-hooks/exhaustive-deps -- react-hooks doesn't support `throttle`. |
@@ -62,11 +65,14 @@ export default observer(() => { | |||
62 | ); | 65 | ); |
63 | 66 | ||
64 | return ( | 67 | return ( |
65 | <Box | 68 | <Box flex={1} ref={ref}> |
66 | sx={{ | 69 | {children} |
67 | flex: 1, | 70 | </Box> |
68 | }} | ||
69 | ref={ref} | ||
70 | /> | ||
71 | ); | 71 | ); |
72 | }); | 72 | } |
73 | |||
74 | BrowserViewPlaceholder.defaultProps = { | ||
75 | children: undefined, | ||
76 | }; | ||
77 | |||
78 | export default BrowserViewPlaceholder; | ||