*** Does anybody have an idea why {index} in the Redirect is being always the last item of the items array????
I am bumping my head against the wall for this. It should work?! Thanks.
NOTE: Code removed for brevity.
interface IRedirect {
cat: number;
slideId: number;
}
const Redirect = (props: IRedirect) => {
let hist = useHistory();
return (
{
const pass = `/newsdetail/${props.cat}/${props.slideId}`; *<------------ ALWAYS the same number, not the index*
hist.push(pass);
}} className="readmore">Read more ....
</Link>)
}
export class NewsCarrousel extends Component
{
render() {
return ( return ( {
items.map((m, index) => {
return (
<Redirect cat={NewsCarrousel.curCategory} *slideId={index}/>*
}
Top comments (1)
It was slick carrousel. Adding a z-index: 10 to current-slide the correct panel now is being clicked. It look like we had a weird javascript 'closure' issue.