From the course: React Native Essential Training
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Preparing the PanHandlers - React Native Tutorial
From the course: React Native Essential Training
Preparing the PanHandlers
- [Instructor] The first thing we need to do to implement the swiping of the deal images feature is to make the active image index part of the component state because we want to change the image index and have the image changes. So let's do that first. I'll name it image index. And this starts from zero and in here, instead of hard coding the first element here we'll read the image from this.state.image index. Let me format everything. So this should not really change anything, except now we have the ability of changing the image index and that would change the image. In fact, we could test that from the developer tool. So I'll look for the detail view, go in here, change the image index to one and see the image changes. The next thing we can do is to define the PanResponder. So from React Native we'll import PanResponder. We'll also import Animated 'cause we know we need to use Animated as well. So we have PanResponder…
Contents
-
-
-
-
-
-
-
(Locked)
Preparing for swiping1m 17s
-
(Locked)
The Animated and Easing APIs4m 19s
-
(Locked)
Creating an animation loop6m 31s
-
(Locked)
Considering the device dimensions6m 50s
-
(Locked)
The PanResponder API3m 51s
-
(Locked)
Preparing the PanHandlers3m 46s
-
(Locked)
Swiping left and right6m 9s
-
(Locked)
Handling swipe gestures7m 44s
-
(Locked)
Opening URLs2m 57s
-
(Locked)
-
-