innocces / taro-hooks

Hooks Library for Taro
https://next-taro-hooks.pages.dev
MIT License
423 stars 35 forks source link

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

Closed OrrinHatch closed 7 months ago

OrrinHatch commented 1 year ago

版本

复现步骤

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

你期望的现象?

现有的现象?

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

截屏2023-09-21 17 48 20
github-actions[bot] commented 1 year ago

welcome discuss in wechat:

innocces commented 1 year ago

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

innocces commented 1 year ago

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

innocces commented 1 year ago

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

OrrinHatch commented 12 months ago
截屏2023-10-07 09 34 12
innocces commented 12 months ago

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

OrrinHatch commented 12 months ago

是的

innocces commented 12 months ago

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

{
  '@taro-hooks/core': '@taro-hooks/plugin-react/dist/runtime'
}
innocces commented 12 months ago

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

OrrinHatch commented 11 months ago

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

OrrinHatch commented 11 months ago
截屏2023-10-12 18 43 42
OrrinHatch commented 11 months ago

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

OrrinHatch commented 11 months ago

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

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

可以解决这个bug

innocces commented 11 months ago

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

OrrinHatch commented 11 months ago

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

innocces commented 11 months ago

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

innocces commented 11 months ago

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

TARO_ENV: JSON.stringify(process.env.TARO_ENV?.toLocaleUpperCase())
stale[bot] commented 9 months ago

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[bot] commented 7 months ago

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.