Describe the bug
When the story name is "Map". For example:
storiesOf('Map', module)
.add('default', () => <Map/>)
I receive the following console warning
Warning: Failed prop type: Invalid prop `isExpanded` of type `function` supplied to `SidebarItem`, expected `boolean`.
in SidebarItem
in Unknown (created by Tree)
in Tree (created by TreeState)
in section (created by Context.Consumer)
in Styled(section) (created by TreeState)
in TreeState
in div (created by Context.Consumer)
in Styled(div)
in Unknown
in Unknown (created by Context.Consumer)
in Styled(Component) (created by Sidebar)
in nav (created by Context.Consumer)
in Styled(nav) (created by Sidebar)
in Sidebar (created by Context.Consumer)
in _default (created by Layout)
in div (created by Context.Consumer)
in Styled(div) (created by Nav)
in Nav (created by Layout)
in Layout (created by Context.Consumer)
in WithTheme(Layout) (created by ResizeDetector)
in ResizeDetector
in div (created by Context.Consumer)
in Styled(div)
in Unknown
in Unknown (created by ResizeDetector)
in ResizeDetector
in Unknown
in Unknown (created by Manager)
in ThemeProvider (created by Manager)
in Manager (created by Context.Consumer)
in Location (created by QueryLocation)
in QueryLocation (created by Root)
in LocationProvider (created by Root)
in HelmetProvider (created by Root)
in Root
To Reproduce
Steps to reproduce the behavior:
System:
Additional context
Wasn't an issue in 4.1.13. Appeared in 5.0.0. Obviously the easy solution is to not name any stories Map. I just found it peculiar
That's pretty bizarre. Ring any bells @ndelangen ?
I've got the same warning. I don't have any story named Map.
v5.0.3
Same issue here, but the problem story is called Filter.
maybe all array functions are problematic?
Could you confirm the problem in 5.1.0-alpha.13? I can't reproduce.
I'm having the exact same issue. 5.0.5 currently but had same issues at earlier 5.x.x versions. I have a "Map" story as well which probably broke it.
@Armanio I just confirmed it's still an issue in 5.1.0-alpha.14 and 5.0.5.
Steps to reproduce
npx create-react-app storybook-bug && cd $_npx -p @storybook/[email protected] sb initstoriesOf('Button', module) to storiesOf('map', module) yarn run storybookThe warning triggers when a story is named the same as any array functions regardless of case (ie: map/Map, reduce/Reduce, filter/Filter, splice/Splice, etc) except for the camel-cased functions (ie indexOf, forEach etc).
I'm able to reproduce the warning if I follow the steps @jakehewitt provides above by creating a new project and then installing storybook as a dependency. However, I cannot reproduce this if I use the cra-kitchen-sink example inside the storybook repo, or if I yarn link my local storybook from the external project.
Is there a production build or something that needs to run to reproduce this from within storybook? I investigated this bug a bit and have a potential fix, but I'm unable to test it at the moment.
@dougmacknz Perhaps you need to run your storybook with the --no-dll option?
Thanks @shilman - that works. I'll have PR up with a fix for this a bit later on.
@dougmacknz i'm super curious .. thanks for taking this on!!!
Zoinks!! I just released https://github.com/storybooks/storybook/releases/tag/v5.1.0-alpha.18 containing PR #6290 that references this issue. Upgrade today to try it out!
Because it's a pre-release you can find it on the @next NPM tag.
Closing this issue. Please re-open if you think there's still more to do.
Ol茅!! I just released https://github.com/storybooks/storybook/releases/tag/v5.0.6 containing PR #6290 that references this issue. Upgrade today to try it out!