最新react-native(Expo)安裝使用antd-mobile-rn組件庫


1\安裝antd-mobile-rn 庫

npm install antd-mobile-rn --save

2、按需加載

npm install babel-plugin-import --save-dev

3、修改.babelrc配置如下

{
  "presets": [
    "react-native"
  ],
  "plugins": [
    [
      "import",
      {
        "libraryName": "antd-mobile-rn"
      }
    ]
  ]
}

4、引入組件

import { Button } from 'antd-mobile-rn';

5、使用組件

<Button>6</Button>

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2026 CODEPRJ.COM