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

bug: taro-hooks2.0 不支持rn #60

Closed
OrrinHatch opened this issue Sep 21, 2023 · 19 comments
Closed

bug: taro-hooks2.0 不支持rn #60

OrrinHatch opened this issue Sep 21, 2023 · 19 comments
Labels
bug Something isn't working taro-hooks-next next version own wontfix This will not be worked on

Comments

@OrrinHatch
Copy link

版本

  • taro-hooks: 2.0.6
  • taro: 3.6.13
  • node: 18.16.0
  • npm: 9.5.1
  • OS: mac m2 Pro
  • Browser: chrome

复现步骤

按照官网2.X文档进行安装, @taro-hooks/plugin-react 也安装了

你期望的现象?

现有的现象?

复现 repo(最好可以提供一个复现的 repo)

截屏2023-09-21 17 48 20
@OrrinHatch OrrinHatch added the bug Something isn't working label Sep 21, 2023
@github-actions
Copy link

welcome discuss in wechat:

@innocces
Copy link
Owner

innocces commented Sep 21, 2023

emmm~ rn貌似要配置 metirc。 这个mark一下周末看看~~
或者有兴趣可以一起看看。其实 @taro-hooks/core 是做了一个软链。rn可能没有被扫到

@innocces innocces added the taro-hooks-next next version own label Sep 21, 2023
@innocces
Copy link
Owner

innocces commented Oct 2, 2023

有在 config 里的 plugin 声明 '@taro-hooks/plugin-react' 么? 配置

@innocces
Copy link
Owner

innocces commented Oct 2, 2023

如果配置了的话可以把完整的 config/index.js 贴出来看下么

@OrrinHatch
Copy link
Author

截屏2023-10-07 09 34 12

@innocces
Copy link
Owner

innocces commented Oct 7, 2023

是直接用的官方的rn-template创建的项目么?

@OrrinHatch
Copy link
Author

是的

@innocces
Copy link
Owner

innocces commented Oct 7, 2023

ok ~ mark 一下周末看看. 或者直接在 alias 里加一下:

{
  '@taro-hooks/core': '@taro-hooks/plugin-react/dist/runtime'
}

@innocces
Copy link
Owner

innocces commented Oct 7, 2023

似乎看起来动态修改 webpack 的 define 在 rn 这边不会被合并到 metro 的配置中

@OrrinHatch
Copy link
Author

Taro hooks 2.0 rn端 又爆出找不到TARO_ENV

@OrrinHatch
Copy link
Author

截屏2023-10-12 18 43 42

@OrrinHatch
Copy link
Author

没办法,我还是降到1.5的版本吧

@OrrinHatch
Copy link
Author

ok ~ mark 一下周末看看. 或者直接在 alias 里加一下:

{
  '@taro-hooks/core': '@taro-hooks/plugin-react/dist/runtime'
}

可以解决这个bug

@innocces
Copy link
Owner

所以是已经解决了么? 还是?

@OrrinHatch
Copy link
Author

解决了@taro-hooks/core, 又有其他bug

@innocces
Copy link
Owner

那看起来rn确实不能在webpack里面动态插值。这个得好好看看。

@innocces
Copy link
Owner

试试在 config.ts 里的 define 里加一下

TARO_ENV: JSON.stringify(process.env.TARO_ENV?.toLocaleUpperCase())

Copy link

stale bot commented Dec 12, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Dec 12, 2023
@innocces innocces removed the wontfix This will not be worked on label Dec 16, 2023
Copy link

stale bot commented Feb 14, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Feb 14, 2024
@stale stale bot closed this as completed Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working taro-hooks-next next version own wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants