antd-mobile , с использованием babel-plugin-import , Uncaught Ошибка: недопустимый тип элемента - PullRequest
0 голосов
/ 07 сентября 2018

"redux": "^ 4.0.0", узел: v10.2.1

.babelrc

{
    "presets": ["env", "react"],
    "plugins": [
        "babel-plugin-transform-runtime",
        "transform-object-rest-spread",
        ["import", { "libraryName": "antd-mobile",  "style": "css"}] 
    ]
}

сценарий:

import { Button } from "antd-mobile";
...
<Button type="primary">primary</Button>
...

тогда приходит:

invariant.js:42 Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.

Check the render method of `Button`.

как я могу это исправить?

...