Skip to content

Commit b19e2a1

Browse files
authored
fix: CSS transitions not working when a prop is added or removed (#9014)
## Summary I introduced a foolish bug in #8982 while migrating from the `folly::dynamic` to the `jsi::Value` usage as I forgot to update `isNull()` checks to `isUndefined()` (undefined values were automatically converted to nulls in `folly::dynamic` so we had to use `isNull` before). ## Example recordings | Before | After | |-|-| | <video src="https://github.com/user-attachments/assets/32947faa-b0f8-4f72-80ee-5df2878caf38" /> | <video src="https://github.com/user-attachments/assets/146da9e1-cafc-4751-b03b-434c681ece81" /> | It also displayed this warning before: <img width="1199" height="329" alt="Screenshot 2026-02-26 at 01 04 16" src="https://github.com/user-attachments/assets/254110b1-3f04-45f5-95d8-ea6c92a852b0" />
1 parent abb8469 commit b19e2a1

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

apps/fabric-example/ios/Podfile.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/react-native-reanimated/Common/cpp/reanimated/CSS/interpolation/values/ValueInterpolator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ void ValueInterpolator::updateKeyframes(jsi::Runtime &rt, const jsi::Value &keyf
5151
}
5252

5353
bool ValueInterpolator::updateKeyframes(jsi::Runtime &rt, const jsi::Value &fromValue, const jsi::Value &toValue) {
54-
auto from = fromValue.isNull() ? defaultStyleValue_ : createValue(rt, fromValue);
55-
auto to = toValue.isNull() ? defaultStyleValue_ : createValue(rt, toValue);
54+
auto from = fromValue.isUndefined() ? defaultStyleValue_ : createValue(rt, fromValue);
55+
auto to = toValue.isUndefined() ? defaultStyleValue_ : createValue(rt, toValue);
5656

5757
const auto equalsReversingAdjustedStartValue = reversingAdjustedStartValue_ && (*to == *reversingAdjustedStartValue_);
5858
reversingAdjustedStartValue_ = keyframes_.empty() ? from : keyframes_[1].value.value();

0 commit comments

Comments
 (0)