Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Props: Fix typescript unspecified default value #9873

Merged
merged 1 commit into from Feb 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -4,10 +4,7 @@ exports[`react component properties 8143-ts-imported-types 1`] = `
Object {
"rows": Array [
Object {
"defaultValue": Object {
"detail": undefined,
"summary": "0",
},
"defaultValue": null,
"description": "",
"name": "bar",
"required": true,
Expand Down
Expand Up @@ -17,10 +17,7 @@ Object {
},
},
Object {
"defaultValue": Object {
"detail": undefined,
"summary": "1",
},
"defaultValue": null,
"description": "A message alerting about Empire activities.",
"name": "message",
"required": true,
Expand Down
Expand Up @@ -4,10 +4,7 @@ exports[`react component properties 9591-ts-import-types 1`] = `
Object {
"rows": Array [
Object {
"defaultValue": Object {
"detail": undefined,
"summary": "0",
},
"defaultValue": null,
"description": "",
"name": "other",
"required": false,
Expand Down
Expand Up @@ -4,10 +4,7 @@ exports[`react component properties 9592-ts-styled-props 1`] = `
Object {
"rows": Array [
Object {
"defaultValue": Object {
"detail": undefined,
"summary": "0",
},
"defaultValue": null,
"description": "",
"name": "title",
"required": true,
Expand Down
Expand Up @@ -4,10 +4,7 @@ exports[`react component properties 9721-ts-deprecated-jsdoc 1`] = `
Object {
"rows": Array [
Object {
"defaultValue": Object {
"detail": undefined,
"summary": "0",
},
"defaultValue": null,
"description": "",
"name": "width",
"required": true,
Expand All @@ -17,10 +14,7 @@ Object {
},
},
Object {
"defaultValue": Object {
"detail": undefined,
"summary": "1",
},
"defaultValue": null,
"description": "The size (replaces width)",
"name": "size",
"required": true,
Expand Down
Expand Up @@ -4,10 +4,7 @@ exports[`react component properties 9764-ts-extend-props 1`] = `
Object {
"rows": Array [
Object {
"defaultValue": Object {
"detail": undefined,
"summary": "0",
},
"defaultValue": null,
"description": "The input content value",
"name": "value",
"required": false,
Expand All @@ -17,10 +14,7 @@ Object {
},
},
Object {
"defaultValue": Object {
"detail": undefined,
"summary": "1",
},
"defaultValue": null,
"description": "",
"name": "defaultChecked",
"required": false,
Expand All @@ -30,10 +24,7 @@ Object {
},
},
Object {
"defaultValue": Object {
"detail": undefined,
"summary": "2",
},
"defaultValue": null,
"description": "",
"name": "checked",
"required": false,
Expand Down
Expand Up @@ -17,10 +17,7 @@ Object {
},
},
Object {
"defaultValue": Object {
"detail": undefined,
"summary": "1",
},
"defaultValue": null,
"description": "",
"name": "foo",
"required": true,
Expand All @@ -30,10 +27,7 @@ Object {
},
},
Object {
"defaultValue": Object {
"detail": undefined,
"summary": "2",
},
"defaultValue": null,
"description": "",
"name": "bar",
"required": false,
Expand Down
Expand Up @@ -30,10 +30,7 @@ Object {
},
},
Object {
"defaultValue": Object {
"detail": undefined,
"summary": "2",
},
"defaultValue": null,
"description": "Simple click handler",
"name": "onClick",
"required": false,
Expand Down
2 changes: 1 addition & 1 deletion addons/docs/src/frameworks/react/typeScript/handleProp.ts
Expand Up @@ -23,5 +23,5 @@ export function enhanceTypeScriptProp(extractedProp: ExtractedProp, rawDefaultPr
}

export function enhanceTypeScriptProps(extractedProps: ExtractedProp[]): PropDef[] {
return extractedProps.map(enhanceTypeScriptProp);
return extractedProps.map(prop => enhanceTypeScriptProp(prop));
}