React calls getSnapshot while rendering and when checking whether the external store value has changed.