react-native-looped-carousel icon indicating copy to clipboard operation
react-native-looped-carousel copied to clipboard

Check children's keys before resetting currentPage.

Open awochna opened this issue 7 years ago • 1 comments

This allows the children to still be dynamic and reset the carousel properly, but does so by checking for key equality and position, rather than component equality.

Setting keys is a common practice for an array of React elements, so those use cases in which an array of elements is being rendered will fit in nicely with this scheme. Those that don't use keys will not have the resetting behavior.

I'll leave documenting the use of keys for children to a separate commit.

Closes #146

awochna avatar Jan 08 '18 02:01 awochna

This builds fine, but travis couldn't pull down node 7 and the job needs to be rerun by someone with write access.

awochna avatar Jan 08 '18 16:01 awochna