Skip to content

Need to explicitly require component in markdown file #451

@marcel-k

Description

@marcel-k

Hi,

I'm trying out react-styleguide and so far i'm impressed and getting there :)

I'm using typescript (with the react-docgen-typescript package) and webpack 2.

It compiles fine and i can get it to work but I need to explicitly require the component in my Markdown file before I can use it:

export const tileExample = ({ ...props }: Props) => {

    return (
        <div>Hello {props.headingText}</div>
    );
};
const TileExample = require('./tileExample').tileExample;
<TileExample headingText={'World'}></TileExample>

When I check the component that is provided on the window object via chrome console it gives me an es6 module object(?):

Object {__esModule: true, tileExample: function}

Is there some config setting I am missing?

my styleguide.config.js only contains the parser and some section config so i'm omitting it here. Also checked it without TypeScript, same result.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions