Uncaught Error: Invariant Violation: findComponentRoot(…, …$110): Unable to find element. This probably means the DOM was unexpectedly mutated

后端 未结 8 515
情深已故
情深已故 2020-11-29 05:43

What I\'m doing wrong with nested cycles in React? I have searched information in Google and I didn\'t find anything suitable. Can you help me find, what I understand wrong?

相关标签:
8条回答
  • 2020-11-29 06:24

    In my case the problem was with the type of the button. ReactDOM gets lost if you use a type="button" in a <button>.

    I removed the type="button" and added a event.preventDefault() on my onClick handler and it worked for me.

    0 讨论(0)
  • 2020-11-29 06:27

    Please also check out this issue in react https://github.com/facebook/react/issues/3811 , this says " it's a current limitation that you can't return more than one component from a React render method. " so you should also check your render if its returning multiple elements

    0 讨论(0)
提交回复
热议问题