TIL_211221

nevermind·2021년 12월 22일
0

TIL

목록 보기
8/27
  • StackNavigation
    • 기본화면이 MainPage.js
    • 다른 js파일 열려면 import 이름 from '경로'
    • <StackScreen>에 페이지화하기
      <Stack.Screen name="AboutPage" component={AboutPage}/>```
      
    • navigation.navigate('이름') 으로 화면이동
      onPress={()=>{navigation.navigate('AboutPage')}
  • 소개 페이지 header 수정하기


👇 Share 기능

import { Share } from "react-native";
 const share = () => {
        Share.share({
            message:`${tip.title} \n\n ${tip.desc} \n\n ${tip.image}`,
        });
    }
<TouchableOpacity style={styles.button} onPress={()=>share()}><Text style={styles.buttonText}>팁 공유하기</Text></TouchableOpacity>

👇 외부 링크(Link) 클릭

  • 설치
    expo install expo-linking
  • import 하기
import * as Linking from 'expo-linking';
  • 연결하기
const link = () => {
Linking.openURL("https://spartacodingclub.kr")
    }
<TouchableOpacity style={styles.button} onPress={()=>link()}><Text style={styles.buttonText}>외부 링크</Text></TouchableOpacity>


과제 수행 중 해결될 때 그 기쁨이란!!
모르고 막막했지만 계속 도전한 나 칭찬해🦾

profile
winwin

0개의 댓글