Skip to content

Commit 355e7d2

Browse files
committed
Update gidle.tsx
1 parent 1a45a5e commit 355e7d2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Random-Generator/app/(tabs)/gidle.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ import { Text, View } from '@/components/Themed';
66

77
export default function TabTwoScreen() {
88

9-
// State variable to hold image URL
9+
// State variable to hold image URL, if useState('') has a default image path, then no need to use useEffect
1010
const [imageUrl, setImageUrl] = useState('');
1111
const totalImages = 1400;
1212

13+
// useEffect will generate a new image when first open the app
1314
useEffect(() => {
1415
const randomNumber = Math.floor(Math.random() * totalImages);
1516

@@ -56,8 +57,8 @@ const styles = StyleSheet.create({
5657
width: '80%',
5758
},
5859
image: {
59-
width: 300,
60-
height: 300,
60+
width: 400,
61+
height: 400,
6162
resizeMode: 'contain',
6263
marginBottom: 20,
6364
}

0 commit comments

Comments
 (0)