Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ui: Input(textarea) 컴포넌트 및 관련 세부기능 생성 #23

Merged
merged 8 commits into from
Jul 16, 2023

Conversation

choyeon2e
Copy link
Contributor

No description provided.

@eugene028
Copy link
Contributor

작업 끝나면 리뷰어에 추가해주셔~

@github-actions
Copy link

Copy link
Contributor

@eugene028 eugene028 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

초연!! 수고했다우.
우리가 atom 컴포넌트를 만드는 이유 중의 하나가 재사용 + 미래 구현에만 집중하기 위해서인데
현재 초연이의 textArea에는 입력받았을 때 그 입력 이벤트를 관리할 수 있는 상태를 얻기 어려운 것 같아!
그래서 textarea에서 관리하는 값을 value로 넘겨주던가,ref 를 이용하여 textarea의 dom을 조작할 수 있도록 외부에서 props를 받아와야 할 것 같아요!!
main 컴포넌트 개발 시 어떻게 하면 textarea에 입력되는 데이터를 백엔드에게 쉽게 넘겨줄 수 있을까? 고민해서 이 부분만 수정해주면 좋을 것 같아오우~

<StyledTextArea
  value={value}
  ref={ref} //생략가능 (선택)
  onChange = {onChange}
  {...props} //이렇게 세팅하면 textarea dom 이 가진 다른 프로퍼티들도 가져올 수 있응 
/>

그럼 나중에 초연이가 만든 컴포넌트를 쓸 일이 있을 때 이렇게 써볼 수 있겠지

<TextArea
      value={value}
      onChange={onChange}
/>
//onChange 함수를 통해서 `value`값 수정하거나, `e.target.value`에 대한 조작 가능 

src/components/atoms/Input/index.tsx Show resolved Hide resolved
src/components/atoms/Input/index.tsx Outdated Show resolved Hide resolved
src/components/atoms/Input/index.tsx Show resolved Hide resolved
src/main.tsx Show resolved Hide resolved
src/styles/theme/global.ts Outdated Show resolved Hide resolved
@@ -1,8 +1,8 @@
import type { Preview } from "@storybook/react";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

초연이 vscode에서 쓰는 eslint에 설정이 있나??
""''로 바꿔주는 것 같네 !
우리 로컬 eslint로만 작동해야 하는데 내가 세팅을 잘못한 거 같구만... 고쳐보겟씁니당

"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.13.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

헉 이건 왜 버전업이 된걸까요??

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

헉 이건 왜 버전업이 된걸까요??

움.. 처음에 시작할 때 yarn dev 안되는 오류 났던거 때문에 막 install 해보고 이랬던거 때문인가?.. 정확한 이유는 잘 모르겠다 ㅜ!

src/components/atoms/Input/index.tsx Outdated Show resolved Hide resolved
@github-actions
Copy link

@eugene028 eugene028 merged commit c872a36 into dev Jul 16, 2023
1 check passed
@eugene028 eugene028 deleted the ui/input branch July 16, 2023 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants