Skip to content

Commit

Permalink
On storybook, shorten React props (github#22884)
Browse files Browse the repository at this point in the history
  • Loading branch information
heiskr authored Nov 17, 2021
1 parent 686ca2d commit bd7a203
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pages/storybook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ function displayProps(props: Object) {
const xprops = Object.fromEntries(
Object.entries(props).map(([key, value]) => [
key,
key === 'children' ? ReactDomServer.renderToString(value) : value,
React.isValidElement(value) ? ReactDomServer.renderToString(value) : value,
])
)
return JSON.stringify(xprops, null, 2)
Expand All @@ -193,7 +193,7 @@ export default function Storybook() {
<div className="my-4 d-lg-flex flex-items-start">
<nav className="menu col-12 col-lg-3 mr-4 color-bg-subtle position-lg-sticky top-0">
{stories.map(({ name }) => (
<a className="menu-item" href={`#${name}`}>
<a key={name} className="menu-item" href={`#${name}`}>
{name}
</a>
))}
Expand Down

0 comments on commit bd7a203

Please sign in to comment.