mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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:
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);
|
||||
|
||||
Reference in New Issue
Block a user