React native EStyleSheet
Expected Behavior
I am having the following component: https://bit.dev/nadzic/test/test which I imported (npm i @bit/nadzic.test.test) and then text 'TESTOR' is there, but noone of styles is applied (it is in the dependecies).
Styles should be applied.
Actual Behavior
Not applied styles in react native.
Steps to Reproduce the Problem
- Make simple component and export it
- Import it in another project and styles are not applied
Specifications
- Bit version: 14.0.6
- Node version: v8.6.0
- npm / yarn version: 6.4.1
- Platform: Mac os X
- Bit compiler (include version): bit.envs/compilers/[email protected]
- Bit tester (include version): bit.envs/testers/[email protected]
I have one question, since noowhere is react-native mentioned, is the react native supported by bit? Does it make sense to use it or do you recommend something else for sharing components?
Additional to the on the link I've sent https://bit.dev/nadzic/test/test, the compiler is complaining that is not possible to compile. Is there any option that I can do with some dependecies or something that it will be able to compile react-native component?
@nadzic I'm not familiar with react-native-extended-stylesheet so I might miss something.
But it looks for me like an issue with either the react compiler (it might need a special configuration or loader) or a missing call for EStyleSheet.build somewhere in the code.
Hi @GiladShoham,
thank you very much for your answer - I managed that styles are visible in the app where I use the component. You were right, in second app I forgot to build the styles.
I have just one more question, about issue, which bothers me quite a lot:
https://bit.dev/nadzic/test/test if you gou here, the component is not compiled fine.
Do you know where can I manually add depedencies, for example: @babel/runtime, which is required? Or what exactly you suggest me to do that react-native component will be compiled fine in bit web?
@nadzic I'm glad you managed to solve this issue:) regarding adding dependencies: If you want to add the dependency to the example itself you can just add import statement in the code example and we will install the dependency behind the scene. You can see a lot of examples which do more than one import for example: https://bit.dev/react-bootstrap/react-bootstrap/table If you want to add something to the component itself you can require it in the source code and export a new version. In a few days, we plan to release a feature which allows you to move / add / remove / modify specifc dependencies for specific components.
Regarding your specific component and it's rendering, our playground currently running create-react-app internally, and your component is react-native so I'm not sure it will work (if it works with regular create-react-app it will work in the playground, if not it won't work). But we are in final stages of adding support for more playgrounds like Angular, Vue and maybe react-native.
I'm closing this issue since the original issue has been solved, but I'll keep watch it, so feel free to comment here or open a new issue and link to this issue. Or talk with us in our gitter channel - https://gitter.im/bit-src/Bit
Yeah, that would be great that you add for react-native playground support!