-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Need to explicitly require component in markdown file #451
Comments
It worked for me when I did it exactly as shown in react-docgen-typescript readme. One thing I see here (not sure it’s important at all): |
/cc @pvasek |
@sapegin I don't think This would be same for javascript. But you are right the problem here is that example uses the component |
For our project we have the convention to camelCase the stateless component functions, but either way I get the same result :) The issue here is that the result generated and provided on the window object is not the function React.CreateClass expects, but some es6module wrapper object. I can achieve the same result by using the object provided on the window (I am presuming that react-styleguidist is adding the component to the global namespace): // window.tileExample = {__esModule: true, tileExample: function}
const TileExample = window.tileExample.tileExample;
<TileExample ... /> I think @pvasek is right when he says it is probably a typescript issue and I should dive into my webpack config. I thought maybe this was a known issue so I posted here... I will shout out when I resurface from diving ;) |
@marcel-k sorry, that was my mistake in previous comment (I removed "so"). I don't think that this is typescript related. I think the problem is that you have |
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:
When I check the component that is provided on the window object via chrome console it gives me an es6 module object(?):
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.
The text was updated successfully, but these errors were encountered: