Nextjs / ReactとEmotionを使用して構築している画像スライダーコンポーネントがあります。
私はすべてをきちんとやったような気がします!しかし、私はまだ古くからのエラーを受け取ります...
Error: ImageSliderContainer(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.
これがコンポーネントです...
import ReactDOM from "react-dom";
import ImageSlider from "./ImageSlider";
const images = [
"https://images.unsplash.com/photo-1449034446853-66c86144b0ad?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2100&q=80",
"https://images.unsplash.com/photo-1470341223622-1019832be824?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2288&q=80",
"https://images.unsplash.com/photo-1448630360428-65456885c650?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2094&q=80",
"https://images.unsplash.com/photo-1534161308652-fdfcf10f62c4?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2174&q=80",
];
const ImageSliderContainer = () => {
<ImageSlider slides={images} />;
};
export default ImageSliderContainer;
他のコンポーネントを確認する必要がある場合は、コメントでお知らせください。私はそれが私が見逃しているただのくだらないものであることを本当に望んでいます。
ありがとう!
ImageSliderContainer
コンポーネントに何も返されていません。returnステートメントを追加するだけで、機能するはずです。
const ImageSliderContainer = () => {
return <ImageSlider slides={images} />;
};
お役に立てれば !
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加