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

Addon-info: add keys for separator spans in OneOfType #2743

Merged
merged 2 commits into from
Jan 14, 2018
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions addons/info/src/components/types/OneOfType.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ const OneOfType = ({ propType }) => {
return (
<span>
{propType.value
.map((value, i) => [
<PrettyPropType
key={`${value.name}${value.value ? `-${value.value}` : ''}`}
propType={value}
/>,
i < length - 1 ? <span> | </span> : null,
])
.map((value, i) => {
const key = `${value.name}${value.value ? `-${value.value}` : ''}`;
return [
<PrettyPropType key={key} propType={value} />,
i < length - 1 ? <span key={`${key}-separator`}> | </span> : null,
];
})
.reduce((acc, tuple) => acc.concat(tuple), [])}
</span>
);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"publish": "lerna publish",
"postpublish": "yarn --cwd lib/cli test -o",
"repo-dirty-check": "node ./scripts/repo-dirty-check",
"start": "npm --prefix examples/cra-kitchen-sink run storybook",
"start": "npm --prefix examples/official-storybook run storybook",
"test": "node ./scripts/test.js",
"test-latest-cra": "npm --prefix lib/cli run test-latest-cra",
"chromatic": "npm --prefix examples/official-storybook run chromatic"
Expand Down