''react-native-multiple-select' ref issue

I have a functional page structure and the only part where I get an error is the line of code where the 'ref' is located.

          <MultiSelect

              hideTags
              items={items}
              uniqueKey="id"
              ref={(component) => { multiSelect = component}} //wrong
              onSelectedItemsChange={onSelectedItemsChange}
              selectedItems={selectedItems}
              selectText="Pick Items"
              searchInputPlaceholderText="Search Items..."
              onChangeInput={(text) => console.log(text)}
              altFontFamily="ProximaNova-Light"
              tagRemoveIconColor="#CCC"
              tagBorderColor={Color.PURPLE[800]}
              tagTextColor="#CCC"
              selectedItemTextColor={Color.PURPLE[200]}
              selectedItemIconColor={Color.PURPLE[400]}
              itemTextColor="#000"
              displayKey="name"
              searchInputStyle={{ color: '#CCC' }}
              submitButtonColor={Color.PURPLE[400]}
              submitButtonText="Submit"
              scrollEnabled="false"
            />

            <View>
            { multiSelect ? props.multiSelect.getSelectedItemsExt()  //wrong
                  :
                 null}
            </View>


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source