Skip to content

Commit 0232f04

Browse files
committed
fix: FORCE_REACT_RENDER_FOR_SETTLED_ANIMATIONS feature flag crashes (#8822)
## Summary This PR should fix crashes experienced when the `FORCE_REACT_RENDER_FOR_SETTLED_ANIMATIONS` feature flag was enabled. I was not able to reproduce the issue in our example app but this place seems to be most likely to cause the crash so I hope this PR will resolve the issue.
1 parent e8233bb commit 0232f04

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/react-native-reanimated/Common/cpp/reanimated/Fabric/updates/AnimatedPropsRegistry.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,15 @@ void AnimatedPropsRegistry::update(jsi::Runtime &rt, const jsi::Value &operation
3333

3434
void AnimatedPropsRegistry::remove(const Tag tag) {
3535
updatesRegistry_.erase(tag);
36+
timestampMap_.erase(tag);
3637
}
3738

3839
jsi::Value AnimatedPropsRegistry::getUpdatesOlderThanTimestamp(jsi::Runtime &rt, const double timestamp) {
3940
std::vector<std::pair<Tag, std::reference_wrapper<const folly::dynamic>>> updates;
4041

4142
for (const auto &[viewTag, pair] : updatesRegistry_) {
42-
if (timestampMap_.at(viewTag) < timestamp) {
43+
auto it = timestampMap_.find(viewTag);
44+
if (it != timestampMap_.end() && it->second < timestamp) {
4345
updates.emplace_back(viewTag, std::cref(pair.second));
4446
}
4547
}

0 commit comments

Comments
 (0)