- react 버튼
```
import React, { useState } from "react";
import { HashRouter as Router, Link, useParams } from "react-router-dom";
import { gql } from "apollo-boost";
import { useQuery } from "@apollo/react-hooks";
import styled from "styled-components";
import "../Components/css/styles.css";
const GET_MOVIE_INFO = gql`
{
movies {
id
title
}
}
`;
const MovieList = styled.div`
margin-top: 10px;
color: black;
`;
export default () => {
const { id } = useParams();
const { data } = useQuery(GET_MOVIE_INFO, {
variables: { id: parseInt(id) },
});
return (
{data?.movies?.map((m) => (
<>
{m.title}
))}
```
## 자주 하는 실수
- 기본기능으로 때우려고함
## 큐
- 어차피 헷갈리니 자주보고쓰자
## 내가 모르는 것
- react 버튼
'공부기록' 카테고리의 다른 글
공부기록, 2021-09-01(react 용어) (0) | 2021.09.01 |
---|---|
공부기록, 2021-08-31(recoil persist) (0) | 2021.08.31 |
공부기록, 2021-08-27(react atom) (0) | 2021.08.27 |
공부기록, 2021-08-26(react selector) (0) | 2021.08.26 |
공부기록, 2021-08-25(recoil useRecoilState) (0) | 2021.08.25 |