react-native-iap icon indicating copy to clipboard operation
react-native-iap copied to clipboard

withIAPContext freeze my custom context

Open ithustle opened this issue 3 years ago • 5 comments

Please use Discussion board if you want get some help out of it. Please report issue if there is a bug.

Version of react-native-iap

7.4.1

Version of react-native

0.64.2

Platforms you faced the error (IOS or Android or both?)

Both

Expected behavior

Update state of my Providers. I read data from local database and save on my context and the data does not update.

Actual behavior

Using withIAPContext State data does not update

Tested environment (Emulator? Real Device?)

Emulator

Steps to reproduce the behavior

import React from "react";
import { Provider } from "react-redux";
import { MenuProvider } from 'react-native-popup-menu';
import { NativeBaseProvider } from 'native-base';
import { withIAPContext } from 'react-native-iap';

import AppNavigation from "./src/routes";
import store from "./src/utils/store";
import { TabProvider } from "./src/utils/TabProvider";

const Root = () => (
    <Provider store={store}>
        <NativeBaseProvider>
            <TabProvider>
                <MenuProvider>
                    <AppNavigation />
                </MenuProvider>
            </TabProvider>
        </NativeBaseProvider>
    </Provider>
)

export default withIAPContext(Root);

My app stuck on loading because the value on my custom context doesn't update.

ithustle avatar Sep 16 '21 18:09 ithustle

@r0b0t3d May you kindly check this issue as a contributor of #1482? :pray:

hyochan avatar Sep 19 '21 20:09 hyochan

Hi @ithustle , Let me try to reproduce this case. But could you please clarify

  1. Where is the data that didn't update? In redux's state or your custom context?
  2. Your app works well without useIAPContext?

r0b0t3d avatar Sep 20 '21 01:09 r0b0t3d

Hi @r0b0t3d. Sorry for delay.

  1. My custom context. Redux state works fine.
  2. Yep. For now, I had to downgrade to v6.

ithustle avatar Sep 20 '21 18:09 ithustle

Hi @ithustle , I created a sample repo here https://github.com/r0b0t3d/IapExample. In this example, I have a custom context that load data from async storage. But I could not reproduce the issue, the value is loaded successfully after refreshing.

simulator_screenshot_02B68B92-E390-48A3-8BBD-4C696560F155

r0b0t3d avatar Sep 21 '21 03:09 r0b0t3d

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.

stale[bot] avatar Apr 18 '22 18:04 stale[bot]