Reactjs 如何直接或使用async将reactstrap carousel添加为子组件?

Reactjs 如何直接或使用async将reactstrap carousel添加为子组件?,reactjs,reactstrap,Reactjs,Reactstrap,我正在应用程序中使用reactstrap,但发现react存在一些问题。 import CarouselExample from './Sliders/CarouselExample'; render() { return ( <React.Fragment> <div id="container"> <CarouselExample /> <

我正在应用程序中使用reactstrap,但发现react存在一些问题。

import CarouselExample from './Sliders/CarouselExample';

   render() {

    return (
        <React.Fragment>
            <div id="container">
                <CarouselExample />
            </div>

      </React.Fragment>
    );
  }
}
import CarouselExample from./Sliders/CarouselExample';
render(){
返回(
);
}
}
line报告了一个问题,我对此一无所知,因为我是react redux的新手。我应该在代码中做什么

我从这里抓取了旋转木马的示例代码:

使用16.9.0、“react dom”:“^16.9.0”、“react redux”:“^7.1.0”、“react Strap”:“^8.0.1”、“redux”:“^4.0.4”和“redux thunk”:“^2.3.0”构建的应用程序

容器使用react组件,它只是重复一个图像滑块div

输出:


我试图遵循指南并查找示例实现,但未能解决问题。

看起来您缺少bootstrap 4依赖项和CSS

在index.js文件中安装bootstrap 4.3依赖项和导入bootstrap/dist/css/bootstrap.min.css“

有关更多详细信息,请参阅沙盒:


还要注意在
JSX
中使用
id
标记。重用组件时可能会导致问题。我更喜欢使用
refs
。希望这能有所帮助。

refs的含义是什么?以下是一篇有帮助的文章: