'Window.location.reload() in react-native

I often use window.location.reload on my React Web project.

window.location.reload();

Is there any similar way to reload page(component) in react-native?



Solution 1:[1]

@Coding is Life

import { NavigationEvents } from 'react-navigation';

<NavigationEvents onWillFocus={() => this.goBackReload()}/>

This is the way to reload the page, ie. when you go back to page you got the call back method. Using this method clear all state value and refresh the page. Another way is refresh control using to reload the app.

<ScrollView refreshControl={
    <RefreshControl
        refreshing={this.state.refreshing}
        onRefresh={this._onRefresh} />
    }>
</ScrollView>

When you scroll down the screen onRefresh method trigger.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 benomatis