mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-02 05:03:44 +08:00
Core: Fix showRoots behavior when there's no hierarchy
This commit is contained in:
parent
70997af8ec
commit
529b8470e5
@ -243,7 +243,7 @@ const initStoriesApi = ({
|
||||
// 3. If the user passes showRoots, or doesn't match above, do a simpler splitting.
|
||||
} else {
|
||||
const parts: string[] = kind.split('/');
|
||||
if (showRoots) {
|
||||
if (showRoots && parts.length > 1) {
|
||||
[root, ...groups] = parts;
|
||||
} else {
|
||||
groups = parts;
|
||||
|
Loading…
x
Reference in New Issue
Block a user