File tree Expand file tree Collapse file tree 4 files changed +8
-5
lines changed
packages/react-monaco-editor/src/components Expand file tree Collapse file tree 4 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,10 @@ interface IEditorErrorBoundaryState {
22
22
* The example preview should be rendered as a child of this component. (This component can't just
23
23
* render the preview directly because error boundaries only catch errors in passed-in children.)
24
24
*/
25
- export class EditorErrorBoundary extends React . Component < IEditorErrorBoundaryProps , IEditorErrorBoundaryState > {
25
+ export class EditorErrorBoundary extends React . Component <
26
+ React . PropsWithChildren < IEditorErrorBoundaryProps > ,
27
+ IEditorErrorBoundaryState
28
+ > {
26
29
public state : IEditorErrorBoundaryState = { } ;
27
30
private _lastGoodChildren : React . ReactNode ;
28
31
private _lastErrorTime : number | undefined ;
Original file line number Diff line number Diff line change @@ -79,6 +79,6 @@ export const EditorWrapper: React.FunctionComponent<IEditorWrapperProps> = props
79
79
) ;
80
80
} ;
81
81
82
- const EditorPreview : React . FunctionComponent < { } > = props => {
83
- return < div { ...props } / >;
82
+ const EditorPreview : React . FunctionComponent < React . PropsWithChildren < unknown > > = props => {
83
+ return < div { ...props } > { props . children } </ div > ;
84
84
} ;
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ export interface IEditorWrapperProps {
12
12
editorClassName ?: string ;
13
13
14
14
/** Custom component for the preview. It **must** render the children passed in. */
15
- previewAs ?: React . ComponentType < { } > ;
15
+ previewAs ?: React . ComponentType < React . PropsWithChildren > ;
16
16
17
17
/** Props to use on the wrapper for the rendered example. */
18
18
previewProps ?: { } ;
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ export interface ITypeScriptSnippetProps {
73
73
}
74
74
75
75
/** TypeScript code snippet with a theme similar to Monaco's VS light. */
76
- export const TypeScriptSnippet : React . FunctionComponent < ITypeScriptSnippetProps > = props => {
76
+ export const TypeScriptSnippet : React . FunctionComponent < React . PropsWithChildren < ITypeScriptSnippetProps > > = props => {
77
77
return (
78
78
< SyntaxHighlighter className = { css ( rootClass , props . className ) } language = "tsx" style = { style } >
79
79
{ props . children }
You can’t perform that action at this time.
0 commit comments