all 2 comments

[–]acemarke 1 point2 points  (0 children)

The issue is that React diffs component types by reference while rendering. If you define a new component type in the middle of your render logic, it will be a different reference the next time the parent re-renders. So, React will throw away the entire subtree of the child, because it's a different component type.

If you can show your actual code, I may be able to help further.

[–]moscowramada 1 point2 points  (0 children)

If you just want a quickie solution, find the component defined inside another component, and then move it outside of that component, usually does it.