FlexLayout
FlexLayout copied to clipboard
Duplicate onModelChange listeners
Describe the bug
I'm rendering a FlexLayout that receives props from a parent component after initial render. As a result componentDidMount and componentDidUpdate are called before the FlexLayout is displayed.
In componentDidMount, the onModelChange listener is added and then in componentDidUpdate, it is added once more even though previousModel is undefined.
This results in two onModelChange listeners that result in the callback function attached firing twice every time a change is detected. Is this a problem with an implementation or a bug?
Your Example Website or App
No response
Steps to Reproduce the Bug or Issue
- Initialize a FlexLayout
- Update a property
- Attach the onModelChange callback
- Do an action that results in a model change (selecting a tab)
- Observe that the callback is fired twice
Expected behavior
- Callback is fired once
Operating System
Browser Type?
Browser Version
Screenshots or Videos
Can't upload due to company policy
Additional context
No response
Same issue. Please fix it.