how to not enter space when user press in angular 6 code example

Example 1: open a new form with a button and close the last one

this.Hide();
    var form2 = new Form2();
    form2.Closed += (s, args) => this.Close(); 
    form2.Show();

Example 2: how to rerender a page in React when the user clicks the back button

We had a similar desire and solved it by passing a refresh function from the parent to the child.

for example, when you open the child, you would have something like navigate('Child', { refresh: refreshFunction }

You can then access this function in the child ( via something like this.props.navigation.state.params.refresh(); ) before the back action.