Привет!Я решил установить reactstrap(Bootstrap для react)чтобы использовать систему сеток и устоновить слайдер на сайт но при установке слайдера я получаю вот такую ошибку
./src/Components/Slider.js
103:30-45 'reactstrap' does not contain an export named 'CarouselCaption'.
вот мой код
import React, { Component } from 'react';
import '../App.css';
import {
Carousel,
CarouselItem,
CarouselControl,
CarouselIndicators,
CarouselCaption
} from 'reactstrap';
const items = [
{
src: 'data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%22800%22%20height%3D%22400%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20800%20400%22%20preserveAspectRatio%3D%22none%22%3E%3Cdefs%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%23holder_15ba800aa1d%20text%20%7B%20fill%3A%23555%3Bfont-weight%3Anormal%3Bfont-family%3AHelvetica%2C%20monospace%3Bfont-size%3A40pt%20%7D%20%3C%2Fstyle%3E%3C%2Fdefs%3E%3Cg%20id%3D%22holder_15ba800aa1d%22%3E%3Crect%20width%3D%22800%22%20height%3D%22400%22%20fill%3D%22%23777%22%3E%3C%2Frect%3E%3Cg%3E%3Ctext%20x%3D%22285.921875%22%20y%3D%22218.3%22%3EFirst%20slide%3C%2Ftext%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E',
altText: 'Slide 1',
caption: 'Slide 1'
},
{
src: 'data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%22800%22%20height%3D%22400%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20800%20400%22%20preserveAspectRatio%3D%22none%22%3E%3Cdefs%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%23holder_15ba800aa20%20text%20%7B%20fill%3A%23444%3Bfont-weight%3Anormal%3Bfont-family%3AHelvetica%2C%20monospace%3Bfont-size%3A40pt%20%7D%20%3C%2Fstyle%3E%3C%2Fdefs%3E%3Cg%20id%3D%22holder_15ba800aa20%22%3E%3Crect%20width%3D%22800%22%20height%3D%22400%22%20fill%3D%22%23666%22%3E%3C%2Frect%3E%3Cg%3E%3Ctext%20x%3D%22247.3203125%22%20y%3D%22218.3%22%3ESecond%20slide%3C%2Ftext%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E',
altText: 'Slide 2',
caption: 'Slide 2'
},
{
src: 'data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%22800%22%20height%3D%22400%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20800%20400%22%20preserveAspectRatio%3D%22none%22%3E%3Cdefs%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%23holder_15ba800aa21%20text%20%7B%20fill%3A%23333%3Bfont-weight%3Anormal%3Bfont-family%3AHelvetica%2C%20monospace%3Bfont-size%3A40pt%20%7D%20%3C%2Fstyle%3E%3C%2Fdefs%3E%3Cg%20id%3D%22holder_15ba800aa21%22%3E%3Crect%20width%3D%22800%22%20height%3D%22400%22%20fill%3D%22%23555%22%3E%3C%2Frect%3E%3Cg%3E%3Ctext%20x%3D%22277%22%20y%3D%22218.3%22%3EThird%20slide%3C%2Ftext%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E',
altText: 'Slide 3',
caption: 'Slide 3'
}
];
class Slider extends Component {
constructor(props) {
super(props);
this.state = { activeIndex: 0 };
this.next = this.next.bind(this);
this.previous = this.previous.bind(this);
this.goToIndex = this.goToIndex.bind(this);
this.onExiting = this.onExiting.bind(this);
this.onExited = this.onExited.bind(this);
}
onExiting() {
this.animating = true;
}
onExited() {
this.animating = false;
}
next() {
if (this.animating) return;
const nextIndex = this.state.activeIndex === items.length - 1 ? 0 : this.state.activeIndex + 1;
this.setState({ activeIndex: nextIndex });
}
previous() {
if (this.animating) return;
const nextIndex = this.state.activeIndex === 0 ? items.length - 1 : this.state.activeIndex - 1;
this.setState({ activeIndex: nextIndex });
}
goToIndex(newIndex) {
if (this.animating) return;
this.setState({ activeIndex: newIndex });
}
render() {
const { activeIndex } = this.state;
const slides = items.map((item) => {
return (
<CarouselItem
onExiting={this.onExiting}
onExited={this.onExited}
key={item.src}
>
<img src={item.src} alt={item.altText} />
<CarouselCaption captionText={item.caption} captionHeader={item.caption} />
</CarouselItem>
);
});
return (
<Carousel
activeIndex={activeIndex}
next={this.next}
previous={this.previous}
>
<CarouselIndicators items={items} activeIndex={activeIndex} onClickHandler={this.goToIndex} />
{slides}
<CarouselControl direction="prev" directionText="Previous" onClickHandler={this.previous} />
<CarouselControl direction="next" directionText="Next" onClickHandler={this.next} />
</Carousel>
);
}
}
export default Slider;
Header.js
import React, { Component } from 'react';
import '../App.css';
import FaAlignJustify from 'react-icons/lib/fa/align-justify';
import FaShoppingCart from 'react-icons/lib/fa/shopping-cart';
import FaSearch from 'react-icons/lib/fa/search';
import Slider from "./Slider";
class Header extends Component {
render() {
return(
<div>
<div className="HeaderMain">
<div className="DropMenu" >
<ul className ="MenuButtons" id="TopNav" >
<li className="MenuHeader"><FaAlignJustify /></li>
<li className="Visible"><img src="/images/portland.jpg" alt="portlandlogo"/></li>
<li><a href="#">Home</a></li>
<li><a href="#">Devices</a></li>
<li><a href="#">Delivery & Payment</a></li>
<li><a href="#">Guarantee</a></li>
<li><a href="#">About Us</a></li>
<li className="Visible"><div className="CartMain">
< FaShoppingCart /><span>Cart</span>
<div className="Cart-container"><span className="Cart-span"></span><span className="Cart-text">0</span></div></div></li>
<li className="Visible"><button className="HeaderBtn">Sign in</button></li>
</ul>
</div>
<hr/>
<div className="SecondMenuMain">
<ul className="SecondMenu">
<li><a href="#">TOP SALES</a></li>
<li><a href="#">BRAND FOCUS</a></li>
<li><a href="#">HI-TECH</a></li>
<li><a href="#">BEST SELLERS</a></li>
<li><a href="#">PROJECTS</a></li>
<li><a href="#" className="Support">SUPPORT</a></li>
<li className="Bordered"><div><FaSearch className="Search" /><input placeholder="I`m looking for..."></input></div></li>
</ul>
</div>
<div>
</div>
<Slider />>
</div>
</div>);
}
}
export default Header;
Подскажите почему я получаю такую ошибку и как ее исправить?
Есть сайт https://studentprogramsru/ на главной есть слайдер с текстом Детские каникулы 2018
При нажатии на ссылку сделать, например, ее бг красным, но после нажатия на другую ссылку, применить такой стиль на нее, а у прошлой убратьВозможно...