I am getting this error while working with react:
Warning: <Unknown Component /> is being rendered by both [Unknown] and [Unknown] using the same key (null) in the same place. Currently, this means that they don't preserve state. This behavior should be very rare so we're considering deprecating it. Please contact the React team and explain your use case so that we can take that into consideration.
Warning: setState(...): Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component. This is a no-op.
Here is some context about what we are doing:
We are building an application that dynamically adds and removes views from a container. These views are stored in a ViewStore. There are ViewActions to add and remove views.
All views that are managed in that store have a static ViewKey, which is uniquely used for this view. To add a view you can call ViewActions.addView(<SomeComponent />)
. If the view is already present, it will be replaced.
A ViewContainer renders these views by listening for changes from the ViewStore and renders the view with the key property set to the ViewKey.
When I add a view, which is already present, in reaction to a mouse-click event, everything is fine. When I add the exact same view from the developer console of chrome, and the view is already present, I am getting warnings mentioned above, but everything is working fine (probably, because the view has been rendered before).
How can I get rid of this warning?
EDIT: After some more investigation I found out, that this only happens, when firing the action from the Chrome Developer Console. In Firefox and IE (from the Developer Consoles) this works without problems.
Why do I only see this issue in Chrome?