instea/react-native-popup-menu

popup menu in conjunction with react-native-navigation produces warnings

sparlampe opened this issue · 2 comments

Our application uses both react-native-navigation and react-native-popup-menu. React native navigation documentation describes the following integration with context providers. In our setup we have several bottom tabs, each bottom tab screen is wrapped in a MenuProvider.

This configuration produces the warning below.

In most cases you should not have more MenuProviders in your app (see API documentation). In other cases use skipInstanceCheck prop.

Neither examples nor the documentation shed light on this use case. I am not sure if this is bug or incorrect integration on our part.

hi there...

not 100% sure but from the linked documentation it looks to me that each screen has to have its own context providers as RNN seems to manage screens from native code and I don't see a way for to wrap "whole RNN" with our context (only once)

So I think you are "the other case" when you want/need to have multiple MenuProviders - thus simply use skipInstanceCheck to suppress the warning as you probably know what are you doing.... (so probably this is the second know exception to the rule as described here https://github.com/instea/react-native-popup-menu/blob/master/doc/api.md#menuprovider )

This warning is there to prevent pretty common error from inexperience persons as the incorrect placement of MenuProvider can lead to malformed functionality (mostly wrong positioning).

Thank you very much. We have configured to skip checking the instance. If there is an incorrect placement, we will know where to look first.