ant-design/react-native official website address
install dependencies
npm install @ant-design/react-native --save
链接字体图标
npm install @ant-design/icons-react-native --save
If the icon library introduces an error
can be executed
如果您的react-native版本<0.65
npx react-native link @ant-design/icons-react-native
如果报错unknowed commond link
执行
yarn add react-native-asset --save
yarn react-native-asset @ant-design/icons-react-native
在根目录下新建react-native.config.js文件
添加内容
module.exports = {
assets: ['node_modules/@ant-design/icons-react-native/fonts']
};
Check /project name/android/app/src/main/assets/fonts after completion
if there is a success
If an error is reported when the component is introduced
Please add in babel.config.js
plugins: [
['import', {libraryName: '@ant-design/react-native'}],
]