Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle multiple exports? #95

Open
andrewcroce opened this issue Dec 28, 2016 · 2 comments
Open

Handle multiple exports? #95

andrewcroce opened this issue Dec 28, 2016 · 2 comments

Comments

@andrewcroce
Copy link

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!

@imtoo
Copy link
Contributor

imtoo commented Jan 2, 2017

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

@sbkn
Copy link

sbkn commented Mar 29, 2017

carte-blanche had the same issue. They reference a solution for the same use case in react-styleguidist.

Maybe this could work here also?

@ondrejbartas ondrejbartas reopened this Apr 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants