-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Prompt in React 16 "Warning: A history supports only one prompt at a time" #5707
Comments
I wonder if we can wrap this line in a |
@timdorr The problem is Using |
Yeah, sorry, I had that backwards. What about changing to cDM? Will that work? I'm not a user of |
|
We have the same issue, do you have some workaround guys? |
The suggested workaround to setting 'when' to true in cDM works. Prompt.js should follow this suggestion (facebook/react#11106) and update its code to use cDM instead of cWM. This would get rid of the warning message. |
i have the same issue too, it makes me headache . sos |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Version
react-router-dom 4.2.2
react 16.0.0
Test Case
https://codesandbox.io/s/rrn9vww8pn
Cause
There is a breaking change in React 16:
In the Test Case above each page (Home, About, Topics) has a
Prompt
component. Because of the asynchronous nature of the React 16 lifecycle, history warns about two prompts being mounted at the same time:At no point in time are there actually two
Prompt
components "on screen", but this warning does get triggered.Issue remix-run/history#536 is caused by the same breaking change.
Perhaps issue facebook/react#11106 will provide an answer how to resolve this problem.
The text was updated successfully, but these errors were encountered: