Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Tags
- 프로그래밍기초
- react
- next.js 빌드 오류
- 프로그래머스
- K디지털크레딧
- 부트캠프
- ionic
- styled-components
- react-native
- javascript
- 바이트디그리
- 프로그래밍첫걸음시작하기
- PYTHON
- ionic-react
- 항해99
- 스파르타코딩클럽
- ionic react
- React Native
- 내일배움카드
- CSS
- Firebase
- Algorithm
- mongodb
- styled components
- 알고리즘
- 패스트캠퍼스
- typescript
- spartacodingclub
- HTML
- 스파르타코딩클럽 후기
Archives
- Today
- Total
bravo my life!
[Ionic-React] 회원가입 페이지 만들기 본문
728x90
1. 개요
앞서 배웠던 routing을 이용해 간단한 회원가입 페이지를 만들어 보았다.
유저정보를 입력 후 회원가입 버튼을 클릭해 콘솔에 정보를 띄우자.
2. 코드 상세
//App.tsx
const App: React.FC = () => (
<IonApp>
<IonReactRouter>
<IonRouterOutlet>
<Route exact path="/home" component={Home} />
<Route exact path="/">
<Redirect to="/home" />
</Route>
<Route path="/login" component={Login} exact/>
<Route path="/resister" component={Resister} exact/>
</IonRouterOutlet>
</IonReactRouter>
</IonApp>
);
export default App;
//resister.tsx
const Resister: React.FC = () => {
const [username, setUsername] = useState("");
const [password, setPassword] = useState("");
const [cpassword, setSPassword] = useState("");
function resisterUser() {
console.log(`username: ${username}, password: ${password}, confirm Password: ${cpassword}`);
}
return (
<IonPage>
<IonHeader>
<IonToolbar>
<IonTitle>Resister Page</IonTitle>
</IonToolbar>
</IonHeader>
<IonContent className="ion-padding">
<IonInput
value={username}
type="text"
placeholder="Username?"
onIonChange={(e: any) => setUsername(e.target.value)}
/>
<IonInput
value={password}
type="password"
placeholder="Password?"
onIonChange={(e: any) => setPassword(e.target.value)}
/>
<IonInput
value={cpassword}
type="password"
placeholder="Confirm Password?"
onIonChange={(e: any) => setSPassword(e.target.value)}
/>
<IonButton onClick={resisterUser}>Resister</IonButton>
<p>
Already have an account? <Link to="/login">Login</Link>
</p>
</IonContent>
</IonPage>
);
};
export default Resister;
3. 결과물
'Framework || Library > Ionic-React' 카테고리의 다른 글
[Ionic-React] Firebase로 로그인 구현하기 (0) | 2022.07.10 |
---|---|
[Ionic-React] Firebase 세팅하기 (0) | 2022.07.10 |
[Ionic-React] 로그인 페이지 만들기 (0) | 2022.07.09 |
[Ionic-React] Routing 하기 (0) | 2022.07.09 |
[Ionic-React] input UI 구현하기 (0) | 2022.07.08 |