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
- NanoHttpd
- nginx
- chrome
- react-native
- it
- css
- 코테
- Next
- 코딩테스트
- python
- 오퍼월
- 광고 id
- 티스토리챌린지
- TypeScript
- 개발
- React
- Jenkins
- spring boots
- nuxt
- AWS
- Express
- 오블완
- 백준
- 파이썬
- JavaScript
- Android
- kotlin
- docker
- EC2
- toml
Archives
- Today
- Total
내맘대로 개발일지
[RN] Alert 사용하는 방법 본문
📱테스트 환경
"react": "18.2.0"
"react-native": "0.74.2"
버튼을 눌렀을 때 API 사용후에 '소중한 한표 감사합니다❤️' 창을 띄워주고 싶었는데
React 나 다른 JS 에서 alert('소중한 한표 감사합니다❤️') 이렇게 썼으니까 ..
어차피 RN 도 React 기반이니까 똑같거니 했더니 역시 안됐다 ^^
React Native 에서 Alert 를 사용하는 방법은 다음과같다.
import { Alert } from 'react-native';
Alert.alert('소중한 한표 감사합니다❤️')
이렇게 아주 간단하게 사용할 수 있다.
더 자세한 사용방법은 공식문서에서 확인해볼 수 있는데
확인누르고 콜백받아서 처리를 하거나,
타이틀이나 텍스트도 정해줄 수 있다.
Alert · React Native
Launches an alert dialog with the specified title and message.
reactnative.dev
'Javascript > React-Native' 카테고리의 다른 글
| [RN] Button 만들기 (0) | 2024.10.14 |
|---|---|
| [RN] Input 사용하기 (0) | 2024.10.14 |
| [RN] React Native Admob 설치 (2) | 2024.09.24 |
| [RN] IOS Simulator Error (1) | 2024.09.09 |
| [RN] could not move temporary workspace 에러 (0) | 2024.07.31 |