2017-10-04 6 views
0

React Native Windows을 사용하여 UWP Apps의 모달 구성 요소를 사용하려고했지만 아래 경고가 표시됩니다.네이티브 Windows UWP에 반응하십시오 - 모달 구성 요소를 사용할 수 있습니까?

경고 : "RTCModalHostView"의 기본 구성 요소가 존재하지 않습니다.

React Native Windows 인 UWP Apps에 모달 구성 요소를 사용하려면 어떻게해야합니까? 모달을 만들

https://github.com/Microsoft/react-native-windows/blob/master/docs/CoreParityStatus.md

임시 솔루션 사용자 지정 구성 요소

import React, { Component } from 'react' 
import { View } from 'react-native' 
import Styles from './Styles/ModalStyles' 

export default class Modal extends Component { 
    static propTypes = { 
    visible: React.PropTypes.bool, 
    children: React.PropTypes.object 
    } 

    render() { 
    if (!this.props.visible) return (<View />) 

    return (
     <View style={Styles.modal}> 
     {this.props.children} 
     </View> 
    ) 
    } 
} 

을 사용하는 것입니다 : 당신이에서 사용 가능한 구성 요소를 확인하실 수 있습니다

+0

은 맞춤 구성 요소입니까? 프로젝트 또는 라이브러리에서 구성 요소를 가져 오는 것을 잊어 버린 것 같습니다. –

+0

아니요, 이는 사용자 지정 구성 요소가 아닙니다. https://facebook.github.io/react-native/docs/modal.html – sohda

+0

다음과 같이 구성 요소를 가져 왔습니다. 'react-native'의 'import {Modal, Text, TouchableHighlight, View}', ' – sohda

답변

1

는 공식 모달 구성 요소는 현재 사용할 수 없습니다 스타일 예 :

import { StyleSheet } from 'react-native' 

export default StyleSheet.create({ 
    modal: { 
    position: 'absolute', 
    top: 0, 
    right: 0, 
    bottom: 0, 
    left: 0, 
    backgroundColor: 'rgba(0,0,0,0.5)', 
    flex: 1, 
    justifyContent: 'center', 
    alignItems: 'center' 
    } 
}) 

여기에 전체 참조 : https://github.com/Microsoft/react-native-windows/issues/618

+0

고맙습니다. – sohda

관련 문제