Skip to content

Commit 2b984c4

Browse files
some more types
1 parent f7e973e commit 2b984c4

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/components/CodePreview.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,21 @@ import React, { Component, Fragment } from 'react';
22
import { withStyles } from '@material-ui/core/styles';
33
import { format } from 'prettier';
44
import componentRender from '../utils/componentRender.util';
5+
import {ComponentInt,ComponentsInt} from '../utils/interfaces'
6+
import SortChildren from './SortChildren.jsx'
57

6-
class CodePreview extends Component {
8+
type Props = {
9+
focusComponent: ComponentInt;
10+
components: ComponentsInt;
11+
};
12+
13+
class CodePreview extends Component<Props> {
714
render(): JSX.Element {
8-
const { focusComponent, components } = this.props;
9-
return (
15+
//const {focusComponent, components } : {focusComponent:ComponentInt, components:ComponentsInt } = this.props;
16+
const focusComponent : ComponentInt = this.props.focusComponent;
17+
const components : ComponentsInt = this.props.components;
18+
19+
return (
1020
<div
1121
style={{
1222
width: '500px',

0 commit comments

Comments
 (0)