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
Rendering a component more than once can result in unintended consequences. For example, if your component uses DeferredRender to capture slots, the content of those slots will leak between different renders of the same instance.
I think we should update Phlex to disallow this, raising an error if you attempt to render the same instance of a component more than once. The place to do this would be in __final_call__ which is the method that gets renamed to call after the first render for caching.
Rendering a component more than once can result in unintended consequences. For example, if your component uses
DeferredRender
to capture slots, the content of those slots will leak between different renders of the same instance.I think we should update Phlex to disallow this, raising an error if you attempt to render the same instance of a component more than once. The place to do this would be in
__final_call__
which is the method that gets renamed tocall
after the first render for caching.phlex/lib/phlex/sgml.rb
Lines 97 to 127 in 6a0eb85
I would approach this by first checking for an instance variable and raising if it's true, and then setting that instance variable to true.
The text was updated successfully, but these errors were encountered: