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

请问未来是否会考虑升级依赖以兼容react 18? #1284

Open
cw1997 opened this issue Jan 15, 2023 · 7 comments
Open

请问未来是否会考虑升级依赖以兼容react 18? #1284

cw1997 opened this issue Jan 15, 2023 · 7 comments

Comments

@cw1997
Copy link

cw1997 commented Jan 15, 2023

What problem does this feature solve?

目前该项目有部分peer dependency的版本比较旧因此仍然依赖较早期的react 16||17,例如react-native-picker,大部分情况下这样没什么问题。但是我目前遇到Picker这个组件在expo和Android真机上可以正常工作,但是在iOS真机上显示后会闪退,我猜测可能是某些peer dependency的依赖未升级到最新版导致不兼容react 18

What does the proposed API look like?

希望能兼容react 18

@1uokun
Copy link
Collaborator

1uokun commented Jan 16, 2023

1.现在用的@react-native-picker/picker
2.现在是支持react18的

请按下面内容告诉我们你现在用的版本,才能帮你更好定位问题
http://new-issue.ant.design?repo=ant-design-mobile-rn
image

@lchenfox
Copy link

同样的问题,前两天刚试了,在最新的RN版本,根本没法使用,所以放弃了,在找其他代替方案,初始化一个新项目也不行

@edtam
Copy link

edtam commented Feb 2, 2023

@1uokun 我猜题主的意思是指package.jsonpeerDependencies指定的@react-native-picker/picker版本有点问题,因为v1的包peerDependencies"react": "16 || 17",是否改为"@react-native-picker/picker": ">=1.9.0"比较合适呢?

"@react-native-picker/picker": "^1.9.10",

@FlagDu
Copy link

FlagDu commented Feb 16, 2023

@1uokun @ant-design/react-native 5.0.3使用的是@react-native-picker/picker 1.16.8,而@react-native-picker/picker 1.16.8的peerDependencies需要"react": "16 || 17",所以在下载依赖的时候,与react 18冲突了。

@1uokun
Copy link
Collaborator

1uokun commented Feb 17, 2023

这是npm的问题不是库的问题

npm install @react-native-picker/picker --save --legacy-peer-deps

@FlagDu
Copy link

FlagDu commented Feb 17, 2023

@1uokun 为什么不把直接库的package.json中的react版本改成16 || 17 || 18?这样再在react 18项目中下载@ant-design/react-native 5.0.3的时候,就不会被npm报错了。

1uokun added a commit that referenced this issue Feb 17, 2023
Signed-off-by: 罗坤 <luokun199503@qq.com>
@1uokun 1uokun mentioned this issue Feb 20, 2023
@onlyling
Copy link

同样的问题,前两天刚试了,在最新的RN版本,根本没法使用,所以放弃了,在找其他代替方案,初始化一个新项目也不行

轻量、可靠的 React Native 组件库——小暑

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

No branches or pull requests

6 participants