Skip to content

Add support for composed component via HOC #5

@likeSerge

Description

@likeSerge

Hi! We are using HOC and react-styleguidist on project. We expect to see all exported components in react-styleguidist documentation, but actually HOC-derived components are not loaded.

Version of "react-docgen-typescript": "0.0.5"

Here is our styleguidist.conf.js:

const path = require('path');
const webpackDevConf = require('./webpack-dev.conf');
module.exports = {
    title: 'Documentation',
    components: './../src/**/*.component.tsx',
    ignore:[
        '**/core/**'
    ],
    serverHost: 'localhost',
    serverPort: 3000,
    styleguideDir: path.resolve(__dirname, './../styleguide'),
    webpackConfig: webpackDevConf,
    propsParser: require('react-docgen-typescript').parse
};

And example of Component export using HOC:

import { timerHOC } from './timerHOC';
export const TimerDesktop = ( props: TimerDesktopProps) => {
    return (
        <div className="timer-desktop">
            ...
        </div>
    );
};
export const Timer = timerHOC(TimerDesktop);
export default Timer;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions