how to fix, blank page when trying to use history push in react native - react-native

I am working on a APP, where I created a button that navigates you to other page. I imported react native router and use history from react-router dom.
I created seperated folder with login routs (when user is on login screen he can move to sign-up)
Loginrouts.js :
than I created login.js where the button is, it uses useHistory.push() and it calls signup from loginroute.js
But when button is pressed it only shows blank screen, anyone knows why?

Related

React-native navigate between groups

In a react-native project, I want to navigate to my Dashboard after user successfully logs-in. But both screens are in different groups inside the same navigator (see screen below):
But navigating as usual does not work:--> (ERROR The action 'REPLACE' with payload {"name":"Dashboard"} was not handled by any navigator.)
Any idea how to achieve that?

Route do not been cleaned when unmountOnBlur

I have an application that pass an order from the screen 1 as a param utilizing this.props.navigation.navigate('Screen',{order}) to the screen 2 and do some stuff in the screen 2. Then I navigate to another screen using the Drawer side menu. When I come back to the screen 2 utilizing the drawer menu the order still in the param (the route was not reseted).
I'm using class Component in my project and when I tried to put something like a reset in the componentWillUnmount, but the react native don't let me do that because this would be a asyncronous call.
In my order class I did (Screen 2):
componentWillUnmout() {
// some code
this.props.navigation.reset();
}
In the Screen 1 I did:
this.props.navigation.navigate('Screen 2', {order});
I tried do what was decribed in this question: https://github.com/react-navigation/react-navigation/issues/6915 but I had no sucess.
How could I reset this params in this conditions? Could I made a listener to reset the route when a navigate to another page in the Drawer Menu?
If your second page is an order details, you better use the stack pile of screens by pushing a new one.
this.props.navigation.push('orderDetails', {order});
Like that, you push a screen at the top of the stack. Navigate function search in your route history and if the screen was already open previously, it came back to it.

Vue router how to trigger navigation guards before entering external domain

I have a Vue application and need to know when a user is about to navigate out of my application.
I have a beforeRouteLeave in place that triggers an alert if I go from myvueapp.nl/example to myvueapp.nl/example2 however if I navigate from myvueapp.nl/example to www.google.nl it doesn't trigger.
The reason I need to do this is the following:
You can navigate to /example/123 and this will open the example page and open a modal showing the user data of person 123. when you close this modal a router.go(-1) will be triggered. This allows me to use nested modal views. However if you go from google.com directly to /example/123 and then close the modal you will be send back to google.com. My idea was to check where a user is about to navigate to and if it is outside my domain I will check if the modal is open. is the modal open then close that instead of navigation. If it was already closed then let the user go on their way.
How can I know when a user is about to navigate out of my application?

React native web scraping submit form

I`m trying to set up a little React Native App. The app should have a login screen, after a successful login you go to the next screen where a pdf gets displayed.
The pdf is from a website. So I have to log in on the website (with the data from the login screen) and fill in that form, submit it and finally, I can reach that pdf I want.
Is there a way, like a library or a framework/tool or whatever to achieve that form submit?

Navigating in the same scene with different props

I'm learning react-native with redux and I'm trying to make a kind of social network application.
My problem is: when I'm on a user-1 profile screen and I navigate to user-2 profile, so basically I navigate from Profile.js to Profile.js (same screen) with different props. The problem is when I press the 'back' button, I get the user-2 profile while I should see user-1 profile.
The profile informations are saved in the store with redux.
For navigation I use Actions.sceneKey() from react-native-router-flux.
I already tried :
this.props.navigation.navigate('profile', { key: someRandomKey });
I get "Promise returned from navigate is ignored".
T also tried to save every user profile informations that I visit in an array but I don't know how to manipulate this array when I press back button...