Skip to content
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

RN如何引入平级项目 #596

Closed
Shanbei opened this issue May 23, 2022 · 4 comments
Closed

RN如何引入平级项目 #596

Shanbei opened this issue May 23, 2022 · 4 comments
Labels

Comments

@Shanbei
Copy link

Shanbei commented May 23, 2022

我建立了一个共用的js项目,用来加载相同的功能;
在React项目时,使用npm run reject暴露了配置文件后,加载了这个共用的js项目;
但我在使用RN时,虽然没有限制引入外部js的提醒,却依旧无法找到文件,即使使用了babel-plugin-module-resolver来配置别名也无法找到;
这里是有某些配置的限制吗?
None of these files exist:

@sunnylqm
Copy link

metro不能引入父级目录的文件,这里有个讨论 facebook/metro#7
里面有一些解决方法,但随着版本变化和时间推移可能已经失效,请尽量参考最新的评论尝试

@sunnylqm
Copy link

另外,可以参考 expo 设计的结构和方案来在web和rn间共享代码
https://docs.expo.dev/guides/monorepos/

@github-actions
Copy link

👋 Hey there, it looks like there has been no activity on this issue in the last 90 days. Has the issue been fixed, or does it still require the community attention? This issue will be closed in the next 7 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label Aug 23, 2022
@github-actions
Copy link

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants