Skip to content

Commit

Permalink
Merge pull request #9873 from storybookjs/9827-ts-default-values
Browse files Browse the repository at this point in the history
Props: Fix typescript unspecified default value
  • Loading branch information
shilman committed Feb 20, 2020
2 parents e04d5da + e5698fc commit 3aa12e9
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 49 deletions.
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));
}

0 comments on commit 3aa12e9

Please sign in to comment.