어떻게이 두 구성 요소를 조건부로 렌더링 할 수 있습니까?두 구성 요소를 조건부로 렌더링하는 방법?
if logedin={true}
return
<Card>
<CardItem header>
<Text>NativeBase</Text>
</CardItem>
<CardItem>
<Body>
<Text>
//Your text here
</Text>
</Body>
</CardItem>
<CardItem footer>
<Text>GeekyAnts</Text>
</CardItem>
</Card>
else return
<Text> signup to access this content </Text>
방법이 조건부 렌더링은이 상황에 대해 수행 할 수 있습니다 :
import React, { Component } from 'react';
import { Container, Header, Content, Card, CardItem, Text, Body } from 'native-base';
export default class CardHeaderFooterExample extends Component {
render() {
return (
<Card>
<CardItem header>
<Text>NativeBase</Text>
</CardItem>
<CardItem>
<Body>
<Text>
//Your text here
</Text>
</Body>
</CardItem>
<CardItem footer>
<Text>GeekyAnts</Text>
</CardItem>
</Card>
는 말할 수? 이러한 구성 요소는 부울 logedin
을 기반으로 렌더링해야합니다.