首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >蚂蚁设计-移动工作与创造-反应-本机-应用?

蚂蚁设计-移动工作与创造-反应-本机-应用?
EN

Stack Overflow用户
提问于 2017-05-17 05:37:09
回答 1查看 1.7K关注 0票数 1

我需要从create-react-native-app生成的项目中将{"plugins": [["import", { "libraryName": "antd-mobile" }]]}添加到.babelrc中,以使蚂蚁设计-移动在react本机中工作。

我用create-react-native-app.启动了一个新项目将.babelrc更改为:

代码语言:javascript
复制
 {
  "presets": ["babel-preset-expo"],
  "env": {
    "development": {
      "plugins": [
        "transform-react-jsx-source",
      ]
    }
  },
  "plugins": [
    ["import", { "libraryName": "antd-mobile" }]
  ]
}

类:

代码语言:javascript
复制
import { Button } from 'antd-mobile';

export class Screen extends React.Component<any,{}>{
   render(){
     return(
            <View>
                <Button>Something</Button>
            </View>
        )
   }
}

但是,我仍然会在开始时得到这个错误:

代码语言:javascript
复制
Note: must use https://github.com/ant-design/babel-plugin-import .
For more information, please see https://github.com/ant-design/ant-design-mobile/issues/602

有人能给我找个解决办法吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-05-17 12:42:29

您可以查看官方的react本地应用程序演示:https://github.com/ant-design/antd-mobile-samples/tree/master/react-native

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44016412

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档