관리 메뉴

모든 일에 의문을 제기하고 그 의문을 해결하기 위해 지식을 구하고 공부

React_업로드 Form 만들기 본문

React/강의-youtube따라하기

React_업로드 Form 만들기

GROWNFRESH 2020. 5. 29. 16:48

1. 업로드 페이지 만들기

컴포넌트 파일 생성 > functional component(rfce)  ( React import, export default )

 

2. 업로드 페이지 Route 생성

App.js에서 <Route/> 추가

 

3. 업로드 페이지 Header Tab 추가4. 폼 만들기5. 파일 올리는 zone

 1) npm i react-dropzone --save

 2) 

<Dropzone onDrop multiple maxSize >

                        { ({getRootPropsgetInputProps}) =>(

                            <div style={{width:'300px', height:'240px', border:'1px solid lightgray', display:'flex',

                            alignItems:'center', justifyContent:'center'}} {...getRootProps()}>

                                <input {...getInputProps()} />

                                <Icon type="plus" style={{fontSize:'3rem'}}/>

                            </div>

                        )}

</Dropzone>

 

6. onChange Func

TitleInput, Description, PrivateSelect, CategorySelect >> onChange 함수

'React > 강의-youtube따라하기' 카테고리의 다른 글

React_비디오 디테일 페이지  (0) 2020.06.05
React_랜딩페이지에 video 업로드  (0) 2020.06.03
React_비디오 업로드하기  (0) 2020.06.02
React_썸네일 기능  (0) 2020.06.02
React_Server에 비디오 저장  (0) 2020.06.01