我正在尝试运行以下基本用法react-multi-carousel
:
import React from 'react';
import {Carousel} from 'react-multi-carousel';
export function MyComponent(props) {
// ...
return (
<Carousel>
<div>Item 1</div>
<div>Item 2</div>
</Carousel>
);
};
但我越来越Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports. Check the render method of 'MyComponent'.
我已经安装react-multi-carousel
了npm i react-multi-carousel
. 我究竟做错了什么?任何帮助是极大的赞赏。