커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
배너광고를 aboutpage.js에도 넣고 싶어서 이렇게 했는데
앱개발 종합반 - 리액트 네이티브 v7
5주차
북마크
이*정
댓글
16
추천
0
조회수
19
조회수
19
답변 완료

import React, {useEffect} from 'react'

import {View,Text,StyleSheet,Image, TouchableOpacity} from 'react-native'

import { StatusBar } from 'expo-status-bar';

import * as Linking from 'expo-linking';

const main = "https://firebasestorage.googleapis.com/v0/b/sparta-myhoneytip-jung-23ea7.appspot.com/o/%EC%9D%BD%EC%96%B4%EB%B3%B4%EC%88%912.png?alt=media&token=66dda765-2128-4851-a53b-88ccad24c8fe"

const adUnitId = __DEV__ ? TestIds.BANNER : 'ca-app-pub-6972692989047955/2419480242';//메인상단 가로배너키값



export default function AboutPage({navigation,route}){

 

    useEffect(()=>{

        navigation.setOptions({

            title:"소개 페이지",

            headerStyle: {

                backgroundColor: '#E79496',

                shadowColor: "#1F266A",

            },

            headerTintColor: "#fff",

        })

    },[])

    const link = () => {

        Linking.openURL("https://zepeto.me/contents/preview/CR_62bc4f3be876c14319fd4f71")

    }


    {__DEV__ ? null : (<BannerAd

        unitId={adUnitId}

        size={BannerAdSize.FULL_BANNER}

        requestOptions={{

          requestNonPersonalizedAdsOnly: true,

        }}

      />)}


  return (

  <View style={styles.container}>

       <StatusBar style="light" />

       <Text style={styles.title}>어서와~ 생활 꿀팁은 처음?이지~?</Text>


       <View style={styles.textContainer}>

       <Text style={styles.desc01}>혼자 알기 아까운 꿀팁들 모아뒀으니까 읽어보숑~      가끔씩 업댓도 해볼꾸야!</Text>

       <Image style={styles.main} source={{uri:main}} resizeMode={"cover"}/>

       

       <Text style={styles.desc02}>

        나는 몽숑이야~                    

                         

        그냥  몽이라고 불러.                                   집주소는 밑에 보이는 거기 심심하면 놀러와~ </Text>

       <TouchableOpacity style={styles.button} onPress={()=>link()}><Text style={styles.buttonText}>집주소</Text></TouchableOpacity>

      </View>

      </View>)

}


const styles = StyleSheet.create({

    container: {

      flex:1,

      backgroundColor: "#E79496",

      alignItems:"center"

    },

    title: {

      fontSize: 22,

      fontWeight: '700',

      color:"white",

      paddingLeft:30,

      paddingTop:35,

      paddingBottom:20,

      paddingRight:30

    },

    textContainer: {

        width:330,

        height:550,

        backgroundColor:"white",

        marginTop:20,

        borderRadius:30,

        alignItems:"center"

    },

    main:{

        marginTop:20,

        width:170,

        height:170,

        borderRadius:50

    },

    desc01: {

        textAlign:"center",

        fontSize:20,

        fontWeight:"700",

        paddingLeft:22,

        paddingRight:22,

        marginTop:20,


    },

    desc02: {

        textAlign:"center",

        fontSize:20,

        fontWeight:"700",

        padding:22

    },

    button:{

        backgroundColor:"#E79496",

        padding:10,

        marginBottom:15,

        borderRadius:15

    },

    buttonText: {

        color:"white",

        fontSize:15,

        textAlign:"center",

        fontWeight:"500"

    }

})

--------------------------------

이렇게 터미널창에 에러가 떠요~;

at node_modules\react-native\Libraries\Core\ExceptionsManager.js:null in handleException

at node_modules\react-native\Libraries\Core\setUpErrorHandling.js:null in handleError

at node_modules\expo\build\errors\ExpoErrorManager.js:null in errorHandler

at node_modules\expo\build\errors\ExpoErrorManager.js:null in <anonymous>

at node_modules\@react-native\polyfills\error-guard.js:null in ErrorUtils.reportFatalError

at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:null in __guard

at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:null in callFunctionReturnFlushedQueue

-----------------

코드에는 문제없다고 뜨는데 왜그러는건가요~?

스파르타 즉문즉답


취소
 공유
취소
댓글 0
댓글 알림
나의얼굴