We use a modular project structure which is an adaptation of that which is described in this article. For any given component directory, there are some files that are "public" and others that are considered private implementation details. By convention, only those components exported by the index.js file are considered "public":
// file: Foo/index.js
import Foo from './Foo'
import Bar from './Bar'
export default Foo
export {
Bar
}
// file: Foo/Foo.jsx
import Bar from './Bar'
import BazIsPrivate from './BazIsPrivate'
export default function Foo() {
return (
<div>
<Bar />
<BazIsPrivate />
</div>
)
}
Proposed solution
I would like to propose that either @private and/or @ignore will work on components the same way it currently does for properties:
/**
* @ignore
*/
export default BazIsPrivate(props) {
}
/**
* @private
*/
export default BazIsPrivate(props) {
}
Alternative solutions
I've considered adopting a file naming convention to leverage the existing "blacklisting" functionality, e.g.:
Foo/
_BazIsPrivate.jsx
But this feels suboptimal for a few reasons:
index.js), then we have to rename the file, even though no code changes in the file itself; andskipComponentsWithoutExample option could be another alternative:
https://react-styleguidist.js.org/docs/configuration#skipcomponentswithoutexample
馃槾 This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week without any further activity. Consider opening a pull request if you still have this issue or want this feature.