Comments (1)
@shrinandhini2801 You need to keep a reference to your carousel's instance like this :
<Carousel
ref={(carousel) => { this._carousel = carousel; }}
// other props
/>
Then, whenever needed, you can call the following:
if (this._carousel) {
alert(this._carousel.currentIndex);
}
If you need to update your state every time a change of slide occurs, make sure to use the onSnapToItem
prop instead.
from react-native-snap-carousel.
Related Issues (20)
- how to detect slide animation end??
- snap carousel
- ViewPropTypes will be removed from React native HOT 1
- Fix ViewPropTypes usage for deprecated prop types HOT 2
- h
- This causes issues when switching to RTL in Android
- Upgrade this to new react-native version 0.71
- viewproptypes will be removed from react native issue, fixed. HOT 4
- The loop simply stops while swiping right when it reaches the 3rd index HOT 5
- ViewPropTypes will be removed from React Native, along with all other PropTypes HOT 1
- Align carousel items to the left. HOT 1
- accessing touch gesture handler or control from carousel component
- error while updating property 'transform' of a view managed by rctview
- ViewPropTypes is deprecated HOT 6
- custom carousel with centered image and 2 images in each side
- ViewPropTypes needs to be exported from 'deprecated-react-native-prop-types' package instead 'react-native' HOT 4
- sub Element cannot response click event when scrollView is scrolling. HOT 1
- Dynamic Height Content in Carousel
- when i set startAutoplay to true, it cannot auto play, i do not know wht
- white space is coming if I disabled the infinite scroll HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-snap-carousel.