내 매개 변수가 정의되지 않았는지 확인하는 방법을 찾고 있습니다. 나는 그것을 시도했지만 작동하지 않습니다내 기본 매개 변수가 정의되지 않은 경우 실제 기본 검사
"정의가 ('this.props.navigation.state.params.Username을'평가) 객체가 아닌"
componentWillMount() {
if (typeof this.props.navigation.state.params.Username != 'undefined'){
this.getInfos()
} else {
this.navigate('ComponentOne');
}
}
아직도이 오류가 어떤 생각?
감사
고마워, 대답에 내 오류를 발견! –
@DuvalTheophane 내 답변과 동일하므로 console.log()의 결과는 무엇입니까? – nhoxbypass