Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to present <RCTModalHostViewController... which is already presenting - and increasing warning #2563

Closed
vvusts opened this issue Oct 30, 2017 · 5 comments

Comments

@vvusts
Copy link

vvusts commented Oct 30, 2017

Hi people,

I need urgent help if possible.
I am hitting some serious performance issues and I think that I maybe setup RNRF wrong.
Can somebody check my setup and tell me if I am getting problems from it and what to do to fix this:

<RouterWithRedux>
          <Scene key="modal" component={Modal} >
            <Scene key="root">
              <Scene key="splashScreen" component={SplashScreen} hideNavBar initial />
              <Scene key="homeScreen" component={HomeScreen} type={ActionConst.RESET} hideNavBar />
              <Scene key="productDetails" component={ProductDetails}/>
              <Scene key="wizard" direction="vertical" hideNavBar >
                <Scene key="wizardRoot"  component={WizardRoot} panHandlers={null}/>
                <Scene key="completeScreen" component={CompleteScreen} panHandlers={null}/>
              </Scene>
            </Scene>
          </Scene>
        </RouterWithRedux>

As you can see my app flow is Splash > Home > From home I open product details > From product details I open Wizard as modal > In wizard modal I navigate from one component to another and close it (closing code is: Actions.homeScreen();)
In console I get this warning:
Warning: Attempt to present <RCTModalHostViewController: 0x15bf75500> on <UIViewController: 0x153e081e0> which is already presenting <RCTModalHostViewController: 0x15bf7b800>
And this warning increase.
As I close and open product details screen more and more this warning is always increased by 1.
So oppening it 10 times result each time: 1 warning, 2 warnings ... 10 warnings.

@raynor85
Copy link
Contributor

raynor85 commented Nov 7, 2017

There isn't enough information to see where the problem is honestly, but my suggestion is to be sure to dismiss everything in your components when you hit the back button. I had the same problem when the keyboard was involved. I was able to remove the warning using Keyboard.dismiss() when tapping on the back button. It is probably not what is happening int your case, but I thought it was worth give you a hint.

@aksonov
Copy link
Owner

aksonov commented Nov 10, 2017

Please reproduce the issue with Example project. Closing this ticket for now.

@aksonov aksonov closed this as completed Nov 10, 2017
@mienaikoe
Copy link

mienaikoe commented Nov 13, 2017

I had this error too. I was rendering more than one <Modal /> element in the same root node. After adding code to unmount the first one before opening the second one, the problem went away.

@raynor85
Copy link
Contributor

Should be related to facebook/react-native#10471

@Achilles0509
Copy link

I had this error too. I was rendering more than one <Modal /> element in the same root node. After adding code to unmount the first one before opening the second one, the problem went away.

Can you add code block, please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants