Commit 550aadd
Fix setLayoutAnimationEnabled assigning variable to itself (#56387)
Summary:
`setLayoutAnimationEnabled()` in `LayoutAnimation.js` assigns `isLayoutAnimationEnabled` back to itself instead of the `value` parameter:
```js
// Before (bug)
function setLayoutAnimationEnabled(value: boolean) {
isLayoutAnimationEnabled = isLayoutAnimationEnabled; // no-op
}
// After (fixed)
function setLayoutAnimationEnabled(value: boolean) {
isLayoutAnimationEnabled = value;
}
```
This makes the function a complete no-op, meaning LayoutAnimation can never be toggled at runtime once initialized from the feature flag.
## Changelog:
[GENERAL] [FIXED] - Fix setLayoutAnimationEnabled not applying the value parameter
Pull Request resolved: #56387
Test Plan:
1. Call `LayoutAnimation.setLayoutAnimationEnabled(false)` and verify layout animations are disabled
2. Call `LayoutAnimation.setLayoutAnimationEnabled(true)` and verify they re-enable
3. Previously both calls had no effect due to the self-assignment bug
Reviewed By: Abbondanzo
Differential Revision: D122803610
Pulled By: cortinico
fbshipit-source-id: 7ed2ab77b36ef61fa397778e048be70f2d0ca3701 parent a7f81c8 commit 550aadd
1 file changed
Lines changed: 1 addition & 1 deletion
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
0 commit comments