RN app + Meteor App을 백엔드로 사용하고 있습니다.Meteor를 사용하여 React Native에 목록 표시
게시가 유성에서 설정> 서버> 간행물 :
Meteor.publish('deputies',() => {
return Deputies.find({});
});
서브 스크립은
class Deputies_List extends Component{
render(){
const {deputies}= this.props;
return(
<View>
{this.props.deputies.map(deputy=><DeputyDetail deputy={deputy} key={deputy._id}/>)}
</View>
);
}
}
export default createContainer(params=>{
return{
deputies: Meteor.collection('deputies').find({}),
};
},Deputies_List)
여기서 RN> DeputiesList에서 설정 DeputyDetail 성분이다 :
const DeputyDetail =({deputy})=>{
const{name} = deputy;
return(
<Text>Nom : {name}</Text>
);
}
export default DeputyDetail;
오류 : 메시지가 표시되지 않지만 화면에 아무것도 표시되지 않습니다. 하나의 항목이 있어야합니다.
아이디어가 있으십니까?
이 변경 const DeputyDetail = ({대리}) => { const {name} = 대리인; 이 CONST에 DeputyDetail = ({이름}) =이> { – iiro