1

“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`.

我该如何解决?

4

0 回答 0