Skip to content

Commit 1c334d4

Browse files
committed
updated typescript component
1 parent 1c04fa7 commit 1c334d4

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

@plotly/dash-generator-test-component-typescript/src/components/TypeScriptComponent.tsx

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,17 @@ import {TypescriptComponentProps} from '../props';
44
/**
55
* Component docstring
66
*/
7-
const TypeScriptComponent = (props: TypescriptComponentProps) => {
8-
const {required_string, id} = props;
9-
return <div id={id}>{required_string}</div>;
10-
};
11-
12-
TypeScriptComponent.defaultProps = {
13-
string_default: 'default',
14-
number_default: 42,
15-
bool_default: true,
16-
null_default: null,
17-
obj_default: {
18-
a: 'a',
19-
b: 3
20-
}
7+
const TypeScriptComponent = ({
8+
required_string,
9+
id,
10+
string_default = 'default',
11+
number_default = 42,
12+
bool_default = true,
13+
null_default = null,
14+
obj_default = { a: 'a', b: 3 },
15+
...props
16+
}: TypescriptComponentProps) => {
17+
return <div id={id}>{required_string}</div>;
2118
};
2219

2320
export default TypeScriptComponent;

0 commit comments

Comments
 (0)