Recently i've refactored my Checkbox component to use the new getDerivedStateFromProps static method instead of the deprecated componentWillReceiveProps.
Now i'm experiencing some issues:
1. I had to save another previousValue in the component state and compare it each time with the new values, coming from state or props - (otherwise it won't work, since getDerivedStateFromProps is invoked upon each update, also state change).
2. getDerivedStateFromProps is called 4 times per checkbox change which seems like a waste...
What am i missing here?