I want to update value in another screen but the onclick is is other. Check the images
This is the screen number 1
This is the screen number 2
I want something like, when I clicked in Rui martins, I go back in page one and update the information with Rui martins data. How can I do it?
Related
I use react native.
And when I navigation.goBack() to previous screen, can I go to exact height of previous screen?
In detail, I use Flatlist in previous screen,
so let's say, if I have 1 -> 2 -> 3 screen feed, I scrolled down to 3.
I go another screen then go back from next screen, screen goes to top, which is 1.
can i go to 3 screen's height again?
I am not sure if this is the best answer, but flatlist has scrollToIndex property, that accept index of item you want to scroll. The problem is that you would have to save that index somewhere, like redux. If you want to do this to one or two flatlist it's okay, but if you have multiple of them, it isn't the best answer.
I want the user to fill a form step by step. So right now i have 3 screens with data stored in each screen (via useState) and when user is done with this screen i navigate to the next screen and pass the data along through screen params.
This works fine except when user goes back and forth between the screens, then data from the last step gets lost, because screen gets killed and user would have to reenter it.
So i'm wondering what would be the best way to solve this issue?
react native 0.64
react navigation 5
My favourite way to deal with this sort of multi-page data storing is to use React Context. This way you can add and read which data you've gathered across any component (or in this case screen) that you have wrapped in the provider.
Here's a good resource: https://betterprogramming.pub/react-hooks-and-forms-dedb8072763a
When using react-navigation when you go from one screen to another screen you can easily swipe back to get to the previous screen, but it does not allow you to swipe forward to get back to the screen you came from. Is this possible?
In other words
Screen 1 -> Screen 2 -> Screen 3
Go to Screen 1, then to Screen 2, then to Screen 3. Then you swipe back and get to Screen 2, and swipe back again to get to Screen 1. But if you go from Screen 1 to Screen 2 to Screen 3, then swipe back to Screen 2, how do you swipe forward in Screen 2 to get back to Screen 3? Is this not a thing?
I have researched how to do this and can't find it in the docs anywhere. Please let me know if I am missing it somewhere. Thanks!
EDIT: What I am looking for is the equivalent of backBehavior in the docs but for forwardBehavior
One option is to store forward route in each screen state and then go forward,but this will only help to go one page forward.
to go multiple page forward you have to store it in asyncStorage or somewhere
I am creating tabs in my app using react-navigation by createTabNavigator.
What I want to do is how can I show a portion of next screen in tab in the current screen. The Idea is to show the user that there exist another view
What I have already done is that everything except the for showing the next screen in current one, is there any prop or option that will allow me to shrink down the page container?
This is not possible with react-navigation.
Try using a carousel library like react-native-snap-carousel (https://github.com/archriss/react-native-snap-carousel). As you can see in their showcase apps, this library does exactly what you want.
current selected place
How to do situation like this in react native ?
When I select next place it will show current place map , and when I press back it should show last seen map of that place.
Thanks.
Use redux and store the data like a stack. And on back button press pop out the last object from the stack.