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
{{ message }}
This repository has been archived by the owner on Feb 25, 2024. It is now read-only.
Ok, I see - we send the GRAPH_UPDATED in the useEffect but the last render that did happen was rendering based on the "success" state of the previous layout.
The used solution IMHO tries to fight the React and tries to wait, implicitly, on what should happen most of the time - but there are no conceptual guarantees that this will actually happen. For instance - we can click on another actor in the meantime and create a race condition.
It would be better if we could just avoid any chance of such things happening by making the synchronization of the DOM and Elk layouts more explicit, like for example here: 92d434a
I think it would be possible to avoid those duplicated effects but we'd have to implement derived state from props pattern and we'd have to avoid rendering based on state.matches('success'). So I've chosen a solution closer to XState, at the expense of some wasted rerenders in React.
Ok, I see - we send the
GRAPH_UPDATED
in theuseEffect
but the last render that did happen was rendering based on the "success" state of the previous layout.The used solution IMHO tries to fight the React and tries to wait, implicitly, on what should happen most of the time - but there are no conceptual guarantees that this will actually happen. For instance - we can click on another actor in the meantime and create a race condition.
It would be better if we could just avoid any chance of such things happening by making the synchronization of the DOM and Elk layouts more explicit, like for example here:
92d434a
I think it would be possible to avoid those duplicated effects but we'd have to implement derived state from props pattern and we'd have to avoid rendering based on
state.matches('success')
. So I've chosen a solution closer to XState, at the expense of some wasted rerenders in React.Originally posted by @Andarist in #214 (comment)
The text was updated successfully, but these errors were encountered: