microsoft / react-native-code-push

React Native module for CodePush
http://appcenter.ms
Other
8.98k stars 1.47k forks source link

functional component codePushStatusDidChange is stuck on 4 #2255

Closed appsMerwas closed 1 year ago

appsMerwas commented 2 years ago

I'm trying to turn off the loader once it reach status 0.

codePushStatusDidChange is getting called only once with the status as 4

it is work fine with class component but when i use functional component it is stuck on 4


const App = () => {

  const [isLoading, setIsLoading] = useState(true);

  async function checkCodePushAndSync() {
    try {
      await codePush.sync(
        {
          installMode: codePush.InstallMode.IMMEDIATE,
        },
        status => {
          console.log('status', status);
          if (status == 0) {
            setIsLoading(false);
          }
        },
      );
    } catch (error) {
      console.log('error', error);
    }
  }

  // did mount
  useEffect(() => {
    checkCodePushAndSync();

  }, []);

  if (isLoading) {
    return <PageLoader />;
  } else {
    return (
      <>
        **********
      </>
    );
  }
};

export default codePush({
  checkFrequency: codePush.CheckFrequency.ON_APP_START,
  installMode: codePush.InstallMode.IMMEDIATE,
})(App);

Environment

mohammad-hazim commented 2 years ago

+1 same issue

ferasabufares commented 2 years ago

+1 same issue any one can help ???

AlpMehmet commented 2 years ago

+1 same

clementinoux commented 2 years ago

+1 :)

daba-faith commented 2 years ago

+1 Same issue, any update on this?

ghost commented 2 years ago

This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs within 15 days of this comment.

ghost commented 2 years ago

This issue will now be closed because it hasn't had any activity for 15 days after stale. Please feel free to open a new issue if you still have a question/issue or suggestion.

asamiz commented 1 year ago

Same issue here

harish92 commented 1 year ago

+1 same issue

microsoft-github-policy-service[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs within 15 days of this comment.

microsoft-github-policy-service[bot] commented 1 year ago

This issue will now be closed because it hasn't had any activity for 15 days after stale. Please feel free to open a new issue if you still have a question/issue or suggestion.

microsoft-github-policy-service[bot] commented 1 year ago

This issue will now be closed because it hasn't had any activity for 15 days after stale. Please feel free to open a new issue if you still have a question/issue or suggestion.

wfl-junior commented 1 year ago

same issue here

ParthDev96 commented 12 months ago

+1

Dhanraj-bidchat commented 2 months ago

same +1