Closed ManAnRuck closed 4 years ago
Hey @ManAnRuck
To use react-native in your docz app you will need to alias react-native
to react-native-web
and install react-native-web
as a dependency.
For more details, you can check out the recently updated react-native example here :
https://github.com/doczjs/docz/tree/master/examples/react-native
I took a quick look at your codebase and you might need to also alias react-native-linear-gradient to react-native-web-linear-gradient
Let me know if it works as expected 👍
thanks @rakannimer okay, :) this looks one step better. but still some issues.
first is TypeError: Constructor requires 'new' operator
on Button.mdx
https://github.com/demokratie-live/democracy-app/blob/docs/doczJs/packages/mobile-ui/src/components/Button/Button.mdx
second with styled-components/native in Header.mdx <- here I tried already to add an alias but same issue https://github.com/demokratie-live/democracy-app/blob/docs/doczJs/packages/mobile-ui/src/components/Instruction/Header.mdx
I opened a PR (https://github.com/demokratie-live/democracy-app/pull/1) that should resolve all the issues you're seeing.
Re-writing here what I wrote in the PR description for whoever's interested :
I found three problems in the codebase :
styled-components 4.4.0 has an issue with react-native-web. The next SC release will have the fix built in so make sure to update when it's released. For now I added 4.4.0-reactnativewebfix
Missing tsconfig in repo root causing docz to silently fail when parsing the component props.
docz had an issue where lower case component names (e.g. index.tsx
) had to be manually included in the projects files by modifying filterComponents
in doczrc.js
. Thanks to @esturcke this is no longer an issue so I updated docz
to latest version in the next tag.
awesome!!! 👏 thank you very much for supporting the German democracy 😉
also nice to see the tsconfig styled settings, I was looking for this padding-horizontal 😍
Bug Report
Describe the bug running Docz failed with a lot of Can't resolve & Unexpected token errors for node_modules/react-native library
To Reproduce
git clone https://github.com/demokratie-live/democracy-app/tree/docs/doczJs checkout docs/doczJs branch
run: yarn docz
Expected behavior
let Docz work :)
Environment