You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@velkymx We've thought of a possible solution to this called the "my child cannot be one of my ancestors". Each Nested Screen component will climb up its parent tree and collect the name of all it's parent screens. If the screen it wants to render is contained in this list, it won't render, preventing a possible cycling / infinite loop.
This would render all the screens up but not including the screen that would cause an infinite loop.
Using your example, Screen A would call Screen B, but before the nested screen component renders its referenced screen, it will ask itself, "is my parent the same as my child?" And if so, it won't render its child.
The solution we ultimately ended up going with is passing down an array of rendered screens to each nested screen renderer and preventing re-rendering a screen which has already been rendered, thus preventing an infinite loop.
Steps to Reproduce:
Have 2 screen calling each other with the nested controller
(screen A calls B, Screen B call A)
Go to screen preview
Current Behavior:
The screens loop over each other indefinitely
https://www.dropbox.com/s/dqqmbylgpschjr8/loopingNested.mp4?dl=0
The text was updated successfully, but these errors were encountered: