Fix default imageSource on Filters example (#45799)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45799

No idea how I missed this but I don't think `defaultProps` is a thing in React Native? So the images were not showing

Changelog: [internal]

Reviewed By: joevilches

Differential Revision: D60392853

fbshipit-source-id: 27280033fb719340a809053d6ca98ac3f178c8c3
This commit is contained in:
Jorge Cabiedes Acosta
2024-08-01 10:38:53 -07:00
committed by Facebook GitHub Bot
parent bd0aedc8c3
commit 54a6438eaa
@@ -24,10 +24,6 @@ type Props = $ReadOnly<{
imageSource?: number,
}>;
const defaultProps = {
imageSource: hotdog,
};
function StaticViewAndImage(props: Props): React.Node {
return (
<>
@@ -47,12 +43,12 @@ function StaticViewAndImage(props: Props): React.Node {
</View>
<View style={styles.container}>
<Image
source={props.imageSource}
source={props.imageSource ?? hotdog}
style={[props.style, styles.commonImage]}
resizeMode="contain"
/>
<Image
source={props.imageSource}
source={props.imageSource ? props.imageSource : hotdog}
style={styles.commonImage}
resizeMode="contain"
/>
@@ -60,7 +56,6 @@ function StaticViewAndImage(props: Props): React.Node {
</>
);
}
StaticViewAndImage.defaultProps = defaultProps;
function StaticViewAndImageWithState(props: Props): React.Node {
const [s, setS] = React.useState(true);