Skip to content

How can I refresh my current component in react-native after coming to foreground from background? #20667

Closed
@sjt145

Description

@sjt145

currently i am using below code which restart by whole app but i just want to refresh my current component and not whole app:

componentDidMount() {
AppState.addEventListener('change', (state) => {
          if (state === 'active') {
            RNRestart.Restart();
          } 
         if(state === 'background'){
          console.log('background');
         }
       })
    }

please help me out with these i am new to react-native.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Ran CommandsOne of our bots successfully processed a command.Resolution: LockedThis issue was locked by the bot.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions