Comments (4)
Hi, @sadique007. Don't know if you resolved this already, but just in case:
renderNoMoreCards
is a function that needs to return a component. Also, is called on the render of CardStack, that's why call this.onPressData()
will never work as expected (because will execute that when the CardStack component renders, and not when the last card is swiped).
If you need to execute that after last card swiped, maybe you can use onSwiped
event, of the Card component. But the logic to identify the last card relies on you 🤷♂️ 😞
from react-native-card-stack-swiper.
@sadique007 you can call method in onPress like following ways,
<TouchableHighlight onPress={this.onPressData.bind(this,{params_here})} />
or
<TouchableHighlight onPress={this.onPressData} />
or
<TouchableHighlight onPress={()=>{this.onPressData()}} />
onPressData =()=>{
}
from react-native-card-stack-swiper.
@sadique007 you can call method in onPress like following ways,
<TouchableHighlight onPress={this.onPressData.bind(this,{params_here})} /> or <TouchableHighlight onPress={this.onPressData} /> or <TouchableHighlight onPress={()=>{this.onPressData()}} /> onPressData =()=>{ }
THANKS FOR YOUR RESPONSE!!
but this is not the answer what I am expecting.
I want to call a function without TouchableOpacity/TouchableHighlight/ button. And the function call should be made after last card swipe.
from react-native-card-stack-swiper.
Looks like you are actually looking for the onSwipedAll
event. Just call your function there.
from react-native-card-stack-swiper.
Related Issues (20)
- React Native
- Warning: Failed prop type: Invalid prop `children` supplied to `CardStack`.
- Add resetDeck method
- Convert to TS
- Add build / test / release pipelines
- Linting
- Use react-native-reanimated instead
- No more onSwipedAll? HOT 1
- Add `useNativeDriver` prop in defaultProps for CardStack.js
- Render Over Cardstack HOT 2
- Pagination HOT 4
- Horizontal swiping not working properly
- How to remove upcoming card
- how make other components(such as views) render above cardstack HOT 1
- How to refresh particular card? HOT 3
- InitialIndex does not work
- How to use it in Functional Component HOT 1
- Mapping in Card
- Swiping does not work on android.
- The package not being install on latest expo cli. 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-card-stack-swiper.