-
Notifications
You must be signed in to change notification settings - Fork 28
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
Issues getting this to work #180
Comments
Hi David 🙋♂️, Would you be able to share some code with me so I can gather more context on your problem? You might need to set up either the webpack-loader or the Babel plug-in (see read me for more info) to get it to work. Regarding using it without pretty prop types, that's totally possible! The output of the loader / Babel plug-in is an object that pretty-proptypes simply renders out. You can look at that code to help you understand the object and how to render it out in your own application 😃 That being said, you can modify the appearance of pretty-proptypes with the component prop to suit your usecase / design. That's where I would recommend you start before trying to implement your own. Let me know how you go, happy to help 😀 |
Hi Daniel 👋🏽 Thanks so much for your response! I've just actually set up a new project with next and I think I figured out what I was doing wrong... All our components have the structure:
Whereas, in your example it's:
When I change my component signature to the latter it works just fine. Is there a way to get the first syntax to work at all? Since we have roughly 50 components using that syntax, it'd be a bit of a ball-ache to change them all. I will have a look whether I can figure out how the parsing works - we have quite a neat layout idea for the prop-types table so I'll have to build my own :) Also:
The default props for buttons won't show up - am I missing something in my config? Best wishes and thanks for the help! David |
@danieldelcore Regarding being able to just use the output of the converter, what about allowing a render function to be passed in to the So I was thinking something like this could work?
What do you think? |
No worries at all, always happy to help!
|
@danieldelcore Ok most of my issues seem addressed! Thank you so much :) FCI can live with either way I think - so might just write a script that refactors ExtendsI'll keep an eye on that issue! Thank you :) Pretty-proptypesI will have a play with the component override as that definitely would be the easiest way. However, we want to group & sort the prop types in a specific way so I'm not sure how far I'll get. I can see how I've been an idiot trying to implement this myself since I clearly didn't read the docs properly on using
One last question (I hope) though, if I may:
So I did exactly that, I created my
However, now when I run my application, all I get passed through to props is
I promise I dug through the issues and docs but I'm at a loss... This is how I'm calling my custom table.
And the component I'm using is this:
Best wishes and happy easter 🐰 |
Hey @danieldelcore - thanks for the update to making I've just upgraded locally but I'm running into weird issues in our project... Have a look on this video: If I don't actually access the props, it's fine. However, as soon as I add the parameter to the Another issue seems to be that when a lib is outside of the project folder it can't read the types anymore. We're using NX and our project structure is like this:
Is there any way you can help me with debugging? I'm happy to give those issues a go but not really sure where to start. |
Hi there,
I've installed the package for my nextjs application we're using to build a documentation app.
I've copied the example from the storybook but when I run my app, I'm getting these errors on the console:
The app itself doesn't display anything.
Is there any way to debug & fix that?
Also: Is there a way to literally just get an array of the props rather than having to use
pretty-proptypes
?Best
David
The text was updated successfully, but these errors were encountered: