The following two warnings occur when using custom elements for the next and prev arrows.
Warning: React does not recognize the `currentSlide` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `currentslide` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
warning.js:33 Warning: React does not recognize the `slideCount` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `slidecount` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
I've defined them as stateless functions as follows:
export const PrevArrow = props => (
<button type="button" {...props}>
<PrevIcon />
</button>
);
export const NextArrow = props => (
<button type="button" {...props}>
<NextIcon />
</button>
);
First of all, these are warnings, not errors.
The props that are passed to arrow components, contain slideCount and currentSlide custom props. So, if you're gonna define your arrows like this, you might wanna extract those props out first. Something like this should do:
const {currentSlide, slideCount, ...arrowProps} = props
<button {...arrowProps}>
@laveesingh - thanks for the answer!
did you mean:
const {currentSlide, slideCount, ...arrowProps} = props
<button {...arrowProps}>
did note them as warnings in the title, and have corrected it in the body.
Most helpful comment
@laveesingh - thanks for the answer!
did you mean:
did note them as warnings in the title, and have corrected it in the body.