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

Use getWidth() and wrapping children to have consistent width

Open njpearman opened this issue 8 years ago • 0 comments

I was trying to get a full-width carousel, which wasn't that easy. This might be an improvement, as it assumes full width if no explicit width is set on the Carousel, and pulls that width through as appropriate if it is set.

The wrapping of the children means that they all have consistent width without the width having to be set explicitly. The only thing I don't like about this is creating another View node in the process.

This could be carried further by listening for orientation changes and then pushing the change in width down the component tree.

njpearman avatar Aug 02 '16 16:08 njpearman