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
React Native support #5
Comments
Hey @ecalvi, I'm pretty sure it wouldn't be a problem to generate snippets for React Native components. Did you enable the plugin while connecting?
If you did, could you send us a sample config file and a component to investigate what is the problem? Just an example is enough, if you are not able to share for privacy concerns. |
Hey, sure! This is my config file:
Everything is working wonderfully. I just want to know why isn't there any code snippet or description shown in Zeplin. Is there anything I need to do for it to show? Is there an example react file to see? I looked at the documentation and haven't found any. Thank you! |
It seems there is no problem with the config 🤔 . We're using react-docgen to analyze react components. Could you check out this documentation to find out if your components are constructed like one of the items on the list? You can find the list under Guidelines for default resolvers and handlers section. If it is not one of those, unfortunately we don't support your components for now. Off topic, I see that you have wiki links on the config.
|
Allright. I hope that's the missing bit. I'll check React-Docgen. Thank you! |
Hi @ecalvi, do you have any progress on the issue? |
Sorry, I couldn't make it work last time I tried but haven't had the time to try further. I'm using memo, so maybe that's the problem. Don't know. I think we can close this, though. It would be nice if you guys could include notes on the proper way to document components if you haven't already. Thanks! |
It is mentioned here that react-docgen was not working with |
Oh, nice to hear that! Thank you! |
We released an update for @zeplin/cli-connect-react-plugin. Could you try version 0.2.3 and see if that works for your components? |
Sorry, it doesn't seem to be working. Here's my code:
I don't know. Could it be that I'm using I'm looking at the changelog here and I couldn't find anything that mentioned support for React.memo. Thanks for all the help! |
React-docgen cannot determine whether the exported item in your example is a React component. Here is a related issue: reactjs/react-docgen#336 The second problem with your example component is that we can only create a useful snippet if react-docgen can give us what kind of properties your component has, it requires an propTypes object literal for that. Even if react-docgen could resolve your component, inputs would still be missing on the code snippet. We might not support your component for a time but still you can develop a simple plugin like -- BTW, react-docgen changelog has an item for HOC. The fix was about higher order components in general which cover an issue about React.memo as well. Here is the PR: reactjs/react-docgen#343 |
I guess I was too quick to jump into a conclusion. On a second look I guess the issue I mentioned may be unrelated, but still the error I got while debugging is that react-docgen cannot find a suitable component. Here you can try it: https://reactcommunity.org/react-docgen/ I see that you use Flow. It actually works fine for Flow react components.
Not sure what troubles react-docgen's heuristics when there is My second note on my last comment is still valid. You would require something like this:
|
Thank you so much for your help, @yuqu Thank you! |
Hello, @yuqu Thanks for the support. I'm trying the
So I'm guessing the problem is to be in the translation? |
Hello! Well, ,maybe they updated React-docgen (?). The code I pasted was a simplified version of the one that resulted in the code above, which was the real code.
Where could the problem be? Any ideas? |
Hey, guys! I'm syncing components and everything seems to work:
But I'm not seeing the code snippets in Zeplin even though everything seems to be working fine and the code is working in the react-gen playground. It seems something is getting lost in the translation but since there is no logging I'm not able to know. :-( Cheers! |
Hey @ecalvi, sorry for the late response. I'm still not sure about why would you can see the output on react docgen playground but I could not. I would expect to see the results as you have. About logging, we're working on a log file output which you will be able to see the output for each component and any other process happening. I'll notify you when is it ready. In the meantime, could you share the output of the following commands? Also could you share the full command you are using to connect? |
Hello, @yuqu ! Regarding the playground, I tried again my code in an incognito window:
And yes, it seems to be working:
Regarding the command, this is the command I'm using:
About those commands you ask, this is their output:
&
I also tried updating react-docgen only to no avail. Thank you! |
I think I found what is missing. The script command is missing plugin declaration. Update it like below and give it a try 🤞 Since plugins npm package names can be anything, they are required to be declared when running connect command
|
It worked! Thanks, @yuqu Thanks so much for your help. |
great find, @yuqu, this has been quite a ride to follow. Glad it's settled! |
Thanks, everyone! |
Hey, guys!
I'm testing the new tool. I wanted to know if you tested it in a React Native project.
I'm trying it on mine, and I could connect the components, but I'm not seeing the code snippet. I'm wondering if that's because of the lack of support.
Cheers and thank you!
The text was updated successfully, but these errors were encountered: