Describe the bug
I have two components named A and B. And I call updateTab on A, and render something on B. For example:
// A.tsx
const onFinish = () => {
form.validation().then(res => {
molecule.editor.updateTab({
id,
// I want to store the values of form into tab
data:{...data,taskVariables: res}
})
})
}
// B.tsx
const B = connect(molecule.editor, ({current}) => {
useEffect(() => {
if(current.tab.data.taskVariables){
// do something with taskVariables
}
}, [current])
})
But its' unfortunately to detect the changes of current.
Versions
- OS: MacOS
- Browser: Firefox
- Molecule: @dtinsight/molecule 0.9.0-beta.4.2
To reproduce
Expected
=== could be used to detect the changes of current, so I can do something based on taskVariables.
Actually happening
=== couldn't detect the changes, but I find the current changed indeed. So the problem possibly is that the updateTab use Object.assign to update the current data, but don't change the reference of current.
Describe the bug
I have two components named A and B. And I call updateTab on A, and render something on B. For example:
But its' unfortunately to detect the changes of current.
Versions
To reproduce
Expected
===could be used to detect the changes of current, so I can do something based on taskVariables.Actually happening
===couldn't detect the changes, but I find the current changed indeed. So the problem possibly is that theupdateTabuseObject.assignto update the current data, but don't change the reference of current.