-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
The problem
It will be great if the initialOpen option on this line is allowed to be passed from the styleguide.config with each section similar to sectionDepth.
As I was going to make a PR, I had thought simply removing it from that line will make the one I set in config available to use in the ComponentListRenderer but then I realized every custom options passed to our sections in the config aren't being sent all the way to ComponentsList here.
I understand if we don't want to make initialOpen available at the config level for some reasons but I would like to implement this effect myself of having specific sections in toc expanded and I can't do that if I don't get my custom parameters. Here's me trying to use expand:
module.exports = {
sections: [
{
name: 'Components',
content: 'docs/ui.md',
components: 'components/**/index.js',
exampleMode: 'collapse',
usageMode: 'expand',
expanded: true, // need access to this
sectionDepth: 1,
}
]
}Proposed solution
Make initialOpen set per section from the config and do not override but instead provide defaults for when user didn't set
Alternative solutions
Passing all user options at config and always making them available for developers writing custom styleguide render files