I use pure-react-carousel
library and try to navigate to specific slide by onClick
method of my Button.
Please explain me how to use setStoreState
because I tried to do it by myself (as written in docs) and whole my page where I used it just invisible. I tried to use this.props.carouselStore.setStoreState({ currentSlide: 2 })
.
When I add export withStore my page become invisible. and I get following error.
Error is Uncaught TypeError: Cannot read property 'state' of undefined
my export
export default WithStore(MyComponent, state => ({
currentSlide: state.currentSlide,
}));
The Parenthese are unnecessary. Try this: