Closed zhangchenna closed 6 years ago
me too, 同版本一样的问题
https://github.com/necolas/react-native-web/issues/308 https://github.com/necolas/react-native-web/commit/c56b472258acee7d5bfa8b0fcd485e9b383fc897 使用的normalizeColor 在新的react-native中被移动到了独立的npm包中
能紧急发个包修复这个问题吗?谢谢
貌似没有动静
@zhangchenna 不要引用和使用SegmentedControl控件,可以编译通过,暂时只能这样了
@CodingPapi 看来大家都没有更新新版本吧,这么致命的问题都没人关注 RN 感觉药丸了
can you guys please use english ?
any workaround guys ?
@DavidNorena SegmentedControl will crash on 0.56.0, The workaround is do not import or use it.
Wait for the official update @DavidNorena
遇到了同样的问题
@warmhug
@zhangchenna @z-android for now just make a diff from here, thanks to @CodingPapi ! It's a good workaround until an official update.
Note: It doesn't matter if you don't import SegmentedControl, at least for me it's crashing the whole app, without using it !
Update:
A better workaround for now: (Thanks to @CodingPapi):
Add normalize-css-color package dependency:
$ yarn add normalize-css-color -D
Place this patch at the root directory of your project.
Add a postinstall script in your package.json, so the file will get patched everytime you install something:
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"postinstall": "patch -p0 < segmented.android.js.patch"
},
Note: You should change the patch command if you are working on windows.
The problem has been fixed
Failed to load bundle(http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false) with error:(Unable to resolve module
react-native/Libraries/StyleSheet/normalizeColor
from/Volumes/WORK/react-native-app/node_modules/antd-mobile-rn/lib/segmented-control/segmented.android.js
: Modulereact-native/Libraries/StyleSheet/normalizeColor
does not exist in the Haste module mapRN 56 ANTUI 2.20版本 react 16.4.1