
โ react-native-web-swiper
์๋ ์คํฌ๋กค ๋ฑ ์ด๋ฏธ ๊ตฌํ์ด ์ด๋์ ๋ ๋์ด ์๋ ๋ผ์ด๋ธ๋ฌ๋ฆฌ(์น ์ฌ์ฉ ๊ฐ๋ฅ)
https://reactnative.directory/package/react-native-web-swiper
https://reactnative.directory
reactnative.directory
usage
import { makeImgPath } from "@/utils";
import { NativeStackScreenProps } from "@react-navigation/native-stack";
import { useEffect, useState } from "react";
import { ActivityIndicator, Dimensions } from "react-native";
import Swiper from "react-native-web-swiper";
import { styled } from "styled-components/native";
export default function Movies({
navigation,
}: NativeStackScreenProps<any, "Movies">) {
const [loading, setLoading] = useState(true);
const [nowPlaying, setNowPlaying] = useState([]);
const getNowPlaying = async () => {
const { results } = await (
await fetch(
`https://api.themoviedb.org/3/movie/now_playing?api_key=${API_KEY}&language=en-US&page=1®ion=KR`,
)
).json();
setNowPlaying(results);
setLoading(false);
};
useEffect(() => {
getNowPlaying();
}, []);
return loading ? (
<Loader>
<ActivityIndicator />
</Loader>
) : (
<Container>
<Swiper
loop
timeout={3.5}
springConfig={{
stiffness: 120,
damping: 20,
mass: 1,
}}
controlsProps={{
dotsTouchable: true,
prevPos: false,
nextPos: false,
dotsWrapperStyle: {
width: "100%",
alignItems: "center",
},
}}
containerStyle={{ width: "100%", height: SCREEN_HEIGHT / 4 }}
>
{nowPlaying.map((movie) => (
<View key={movie.id}>
<BgImg source={{ uri: makeImgPath(movie.backdrop_path) }} />
</View>
))}
</Swiper>
</Container>
);
}
React Native Swiper
Web์ด๋ ํธํ๋์ง ์๋ Swiper
https://reactnative.directory/package/react-native-swiper
'๐ธ React Native' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
| React Native - Animation (0) | 2026.02.11 |
|---|---|
| React Native - ์ ์ฉํ Component, API (0) | 2026.01.30 |
| React Native - Dark Mode (0) | 2026.01.26 |
| React Native - npx expo prebuild, ๊ธฐ๊ธฐ ๋ฌด์ ์ฐ๊ฒฐ ๋ชจ๋ํฐ๋ง (0) | 2026.01.21 |
| React Native - React Navigation (0) | 2026.01.21 |