Closed jourdain closed 6 years ago
You really have hard time with code responsibility leakage. This is already managed in each component individually. Therefore, it is not needed to duplicate that check again and again in various layer of your application.
These check are really required here.
As I explained in my previous message, you will always receive a complete set of properties (containing both changed and unchanged props) in componentWillReceiceProps method. Therefore, with your implementation, you will send to the server several useless orders, as you will ask to update some parameters which already have the value you asked for.
No they are not! And if they are, the issue is somewhere else...
Can you point me the code that send those useless information when they are the same? Because that would be their responsibility to handle that use case, not the application or this React component.
BTW, I'm well aware that method get called each time any property change with all the properties.
Better design here: https://github.com/Kitware/paraviewweb/pull/446
I was taking the time to explain so you can learn and get better at your development/design. But I guess you could not grasp what I was talking about.
@jourdain It should work but the implementation is not optimal.
React method
componentWillReceiveProps
will always return the complete set of properties. For each property, you need to check if the new value is different than the current one: