react-bluekit
react-bluekit copied to clipboard
Handle multiple exports?
Seems one cannot export multiple components from a single module. Is this by design? For example, in TestModule.js
:
import React from 'react'
export class ThingOne extends React.Component {
render () {
return (
<div>Thing one here!</div>
)
}
}
export class ThingTwo extends React.Component {
render () {
return (
<div>Thing two here!</div>
)
}
}
yields the error Error parsing component Test/Test.js: Multiple exported component definitions found.
A single export works as expected.
Is there a pattern for multiple exports I should be aware of?
Thanks!
It's not supported by react-docgen which is parsing components within BlueKit. Modules have to export a single component, and only that component is analyzed.
https://github.com/reactjs/react-docgen#guidelines-for-default-resolvers-and-handlers
carte-blanche
had the same issue. They reference a solution for the same use case in react-styleguidist
.
Maybe this could work here also?