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?
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.
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