Haul: Shared components with monorepo

Created on 26 Feb 2020  路  2Comments  路  Source: callstack/haul

Hi!
Can you suggest any solutions for this?
I'm trying to build 2 react-native apps with shared codebase and stuck on components import.

If i import any jsx, this happens
image
image

But if there is no jsx, it works...

image
image
image

I assume that the problem lies in babel/jsx/compiling process...

ENV
"@haul-bundler/core": "^0.17.0",
"@haul-bundler/cli": "^0.17.0",
"react-native": "0.61.5",

question

All 2 comments

It's very odd to be importing a module from different package in monorepo with relative path that goes outside of the RN app package. I suggest to setup your project in a way that treats shared as a dependency and you import it like a node_module dependency.

@zamotany you right. Moreover you should import all your native elements from the single point, because they all connected through the react-native bridge. I forgot about that.
It is just impossible to import 'view' for example from another react-native package, event if they are the same version. Does not matter which bundler were used.

This is not an issue at all, just my misunderstanding of how RN works.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aaronkchsu picture aaronkchsu  路  5Comments

satya164 picture satya164  路  5Comments

dave-irvine picture dave-irvine  路  4Comments

rdy picture rdy  路  3Comments

jurajkrivda picture jurajkrivda  路  4Comments