preface

  • The official documentation address: rn. Mobile. Ant. The design/index – cn
  • Official Github storage address: github.com/ant-design/…

Current project maintenance status

  • Ant Design React Native is no longer maintained by Ant Financial since version 3.x. It is now maintained by Github
  • However, the github repository is currently maintained more frequently in terms of submission frequency.

The installation

npm install @ant-design/react-native --save
or
yarn add @ant-design/react-native

Copy the code

Install dependencies

npm install @react-native-community/cameraroll @react-native-picker/picker @react-native-community/segmented-control @react-native-community/slider react-native-pager-view
or
yarn add @react-native-community/cameraroll @react-native-picker/picker @react-native-community/segmented-control @react-native-community/slider react-native-pager-view


Copy the code

Configurations are imported on demand

  • Installation depends on NPM I babel-plugin-import or yarn add babel-plugin-import

  • Configure the Babel. Config. Js

//babel.config.js module.exports = { presets: ['module:metro-react-native-babel-preset'], "plugins": [// Ant introduces ["import", {libraryName: "@ant-design/react-native"}] // The difference with Web platforms is that no style is required]};Copy the code