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

PropsTable with imported flow props does not work #129

Closed
borsdenold opened this issue Jul 9, 2018 · 5 comments
Closed

PropsTable with imported flow props does not work #129

borsdenold opened this issue Jul 9, 2018 · 5 comments
Labels
bug Something isn't working

Comments

@borsdenold
Copy link

When i use PropsTable with flow props, which described near Component, all working good:

// @flow

import * as React from 'react';

type Props = {
  title: string,
}

const Button = ({ title }: Props): React.Element<*> => {
  return (
    <div>
      {title}
    </div>
  );
};

export default Button;

But if i use props, which described in another file, they are not shown:

types.js

export type Props = {
  title: string,
}
// @flow

import * as React from 'react';
import * as types from '../types';


const Button = ({ title }: types.Props): React.Element<*> => {
  return (
    <div>
      {title}
    </div>
  );
};

export default Button;

Any ideas, why?

@Swapnull
Copy link
Contributor

Swapnull commented Jul 9, 2018

After a bit of poking around, this issue seems to be down to react-docgen. (see reactjs/react-docgen#33).

That issue describes a utility function that works around the problem, this probably needs including in the project to fix this issue.

@pedronauck pedronauck added the bug Something isn't working label Jul 11, 2018
@weslleyaraujo
Copy link

faced the same issue today, took me a while to find out what was going on 😅

@weslleyaraujo
Copy link

@Swapnull can you point me what you mean by this function to work around the issue?

@jeffsee55
Copy link

@weslleyaraujo I think he is referring to this solution - https://github.com/siddharthkp/react-docgen-external-proptypes-handler

@pedronauck
Copy link
Member

I'll close this issue in favor of #240, since both is related to pass custom config to react docgen!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants