Uncaught (in promise) Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
尝试使用 webpack 要求“react-slick”时出现错误。
const React = require("react");
const Slider = require("react-slick");
function MediaCarousel(props) {
const settings = {
dots: true,
infinite: true,
speed: 500,
slidesToShow: 1,
slidesToScroll: 1
};
return !props.stories ? null : <Slider>
<div><h3>1</h3></div>
<div><h3>2</h3></div>
<div><h3>3</h3></div>
<div><h3>4</h3></div>
<div><h3>5</h3></div>
<div><h3>6</h3></div>
</Slider>
}
exports.MediaCarousel = MediaCarousel;