Removed additional wrapping <div> inside each slide
Each slide has a <div> wrapper that is not needed. This looks to be originally used to wrap an array of elements. React offers the ability to use Fragments that replace the old <div> wrapper method. Replacing with a <React.Fragment> will eliminate the <div> wrapper and keep the same functionality.
Fragments: https://reactjs.org/docs/fragments.html
Fixes issue related to this: https://github.com/akiran/react-slick/issues/1180
Examples all working and all tests passing after Snapshot has been updated.
@tazcarper This is a breaking change and might affect lot of existing users. So we can't accept it now.
We are planning to make a major version release where we bundle together all the breaking changes at once and release it as 2.0.
I'd argue this is fixing a breaking change introduced in 23.0. The contents of a slide should be exactly what the direct children, or whatever is specified in the Slide setting, of the Slider contain. Currently, it takes the contents and wraps them with an additional <div>. The additional <div> causes numerous issues because it has no class and cant be directly manipulated / removed. Things like Flexbox, absolute position elements, ect become increasingly more difficult to work with.
To my knowledge, this is unexpected behavior that isn't specifically mentioned in the documentation. nor is it reflected in the original Slick. If you don't want to remove the <div>, consider putting a className on the element so users can directly manipulate it in CSS.
Thank you for your work.
@tazcarper Thanks for pointing this out.
I will consider this in upcoming releases.
Maybe You @tazcarper could use a new setting/configuration option to change the current behavior. If new behavior would be configurable it will not be a breaking change anymore
Same here we are not able to update to any version >= 0.23 because of this. We have custom css classes with flexbox but an additional diff breaks this.
I have same issue as OP. The div is so pointless and annoying...
It's odd this is still an issue