美文网首页
# ReactNative 升级总结

# ReactNative 升级总结

作者: 阳光下的我眯起了眼睛 | 来源:发表于2020-09-17 17:10 被阅读0次

ReactNative 升级总结

ReactNative 从0.53升级到0.63 iOS项目总结

1.

ERROR Invariant Violation: ART has been removed from React Native. It can now be installed and imported from '@react-native-community/art' instead of 'react-native'. See https://github.com/react-native-community/art

新版ART使用方法改变

yarn add @react-native-community/art
or
npm install --save @react-native-community/art

引用方法

import {ART} from 'react-native';
const {Surface, Shape} = ART;

改为

import { Surface, Shape, Path } from "@react-native-community/art";

9.

Invariant Violation: ListView has been removed from React Native. See https://fb.me/nolistview for more information or use deprecated-react-native-listview.

10.

Unrecognized font family 'icomoon'

Unrecognized font family 'icon'

资源引用问题

1.打开react-native-vector-icons插件目录确认Fonts文件夹里面字体,是否拥有icomoon.ttf,icon.ttf。没有复制进去,如果有确认Xocde项目里是否导入,没有的话删除原有引用,重新导入

2.确认Images.xcassets里面引用

3.编辑Info.plist并添加一个名为Fonts的属性

11.

ERROR AnimatedValue: Attempting to set value to undefined

使用中应该

new Animated.Value()  =>new Animated.Value(0)

12.

Echarts⁩图表不显示

因为RN移除WebView组件,Echarts引用没有移除所以修改

Echarts⁩ 在模块的路径下:node_modules /⁨native-echarts⁩/src⁩ / components⁩/Echarts⁩的index.js文件中修改成如下:

import { WebView } from 'react-native-webview';

13.

'react-native-root-toast' 弹窗没反应

1.引用新插件 react-native-root-siblings

2.在App.js 界面加入代码

import { RootSiblingParent } from 'react-native-root-siblings';

return (
    <Provider store={store}>
    <RootSiblingParent>
        <Router>
        </Router>
        </RootSiblingParent>
    </Provider>
);

相关文章

网友评论

      本文标题:# ReactNative 升级总结

      本文链接:https://www.haomeiwen.com/subject/zqzlyktx.html