react-native-dropdown-picker ERROR TypeError: undefined is not an object (evaluating '_ref3.label')

Maliethy·2021년 3월 29일
0

React-Native Error

목록 보기
10/15
post-custom-banner

1. issue

 ERROR  TypeError: undefined is not an object (evaluating '_ref3.label')
This error is located at:     
in DropDownPicker (at ConsultForm.tsx:261)

2. solution

다른 페이지로 넘어갈 때 defaultValue의 값을 null로 만들 것!


  <DropDownPicker
             ...
              defaultValue={selectedConsultType} />

 const onSubmit = useCallback(async () => {
    try {
      Alert.alert('문의가 접수되었습니다.');
      navigation.navigate('Consult');
      setSelectedConsultType(null);
            
      }
      catch(error){
      ...
      }

참조:
https://github.com/hossein-zare/react-native-dropdown-picker/issues/137

profile
바꿀 수 있는 것에 주목하자
post-custom-banner

0개의 댓글