Open Youngju-Jang opened 1 year ago
data : https://api.coinpaprika.com/v1/tickers
function App() {
const [loading, setLoading] = useState(true);
const [coins, setCoins] = useState([]);
useEffect(() => {
fetch("https://api.coinpaprika.com/v1/tickers")
.then((response) => response.json())
.then((json) => {
setCoins(json);
setLoading(false);
});
}, []);
return (
<ul>
{coins.map((coin) => (
<li>
{coin.name} ({coin.symbol}) : {coin.quotes.USD.price}
</li>
))}
</ul>
<h1>The Coins! {loading ? "" : `(${coins.length})`}</h1>
페이지 전환기능
api link
detail link : https://yts.mx/api/v2/movie_details.json?movie_id=~~~
<Route path="/movie/:id" element={<Detail />} />
import { useParams } from "react-router-dom";
const { id } = useParams();
: 깃허브에 결과물 올려줌
"scripts": {
...
"deploy": "gh-pages -d build",
"predeploy": "npm run build"
},