Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

Warning: Exception thrown by hook while handling onSetChildren: Invariant Violation: Item must have been set #256

Closed
Matt-Butler opened this issue Apr 25, 2017 · 5 comments

Comments

@Matt-Butler
Copy link
Contributor

warning

How to reproduce:

  1. Check out the branch modal
  2. npm run install && npm run start
  3. Navigate to the modal functional examples.
  4. Open and close a modal example.
  5. Navigate to another page. You should see this warning in the console:

Warning: Exception thrown by hook while handling onSetChildren: Invariant Violation: Item must have been set

@Matt-Butler
Copy link
Contributor Author

I updated the branch modal-test to demonstrate the issue. I removed all of the code and examples except for the modal.

I have 2 identical modal examples. Only one of the examples throws the warning.

@Matt-Butler
Copy link
Contributor Author

I am starting to think it is unrelated react-router throwing the warning. I found out another way reproduce the issue.
error

  1. Open and close the first modal.
  2. Open the 2nd modal. The warning is in the console.
Warning: Exception thrown by hook while handling onSetChildren: Invariant Violation: Expected onBeforeMountComponent() parent and onSetChildren() to be consistent (28 has parents 22 and 27).
Invariant Violation: Expected onBeforeMountComponent() parent and onSetChildren() to be consistent (28 has parents 22 and 27).

@Matt-Butler
Copy link
Contributor Author

@Matt-Butler
Copy link
Contributor Author

We tried out the example above using react 16.0.0-alpha.11. We could not reproduce the issue with react 16.0.0-alpha.11.

@Matt-Butler
Copy link
Contributor Author

I think we will go forward with this pull request expecting the update to react 16.x to fix the issue:
#224

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

No branches or pull requests

2 participants