You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary:
Fixes#49075
The Image `defaultSource` prop is causing a runtime error from 0.77 just by using it in the Image component (see error in the linked issue). This might be a regression from some changes in the prop processing logic from either #47710, #47713 or #47754.
## Changelog:
[ANDROID] [FIXED] - Fix Image defaultSource runtime error
Pull Request resolved: #49097
Test Plan:
- Verify it doesn't throw any error on runtime anymore for Android.
- iOS behaviour should not be impacted as changes are Android specific
In the RNTester, you can use the following component:
```tsx
import * as React from 'react';
import {Image, View} from 'react-native';
function Playground() {
return (
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
<Image
defaultSource={require('../../assets/bandaged.png')}
source={{
uri: 'https://i.natgeofe.com/n/548467d8-c5f1-4551-9f58-6817a8d2c45e/NationalGeographic_2572187_4x3.jpg',
}}
style={{width: 200, height: 200}}
/>
</View>
);
}
```
Also, this `defaultSource` prop is ignored in debug builds for Android ([as per the docs](https://reactnative.dev/docs/image#defaultsource)) – but I've verified we get the defaultSource as a string, which is what we expect on the native side:
<details>
<summary>Screenshot of the Android logs</summary>

</details>
Reviewed By: javache
Differential Revision: D69052723
Pulled By: cortinico
fbshipit-source-id: 2860dd4c18cefcfcbc4e39f94dfa6305f45773a3
0 commit comments