Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Swiper.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import DefaultControls from './Controls';
const useNativeDriver = false; // because of RN #13377

class Swiper extends React.Component {
children = (() => React.Children.toArray(this.props.children))();
count = (() => this.children.length)();
count = (() => React.Children.toArray(this.props.children).length)();

startAutoplay() {
const { timeout } = this.props;
Expand Down Expand Up @@ -234,6 +233,7 @@ class Swiper extends React.Component {
controlsEnabled,
controlsProps,
Controls = DefaultControls,
children,
} = this.props;

return (
Expand All @@ -257,7 +257,7 @@ class Swiper extends React.Component {
])}
{...this._panResponder.panHandlers}
>
{this.children.map((el, i) => (
{children.map((el, i) => (
<View
key={i}
style={StyleSheet.flatten([
Expand Down