Skip to content

renderButtonText renders '[object Object]' if there is a call to setState in onSelect or renderButtonText functions #139

@Culzean

Description

@Culzean

I have version 0.6.1 and am using a slightly more complex data structure.

         <ModalDropdown
              dropdownStyle={styles.pickerItemStyle}
              style={styles.dropDwon}
              textStyle = {styles.DropDownText}
              dropdownTextStyle = {styles.DropDownPickerText}
              renderButtonText = { (rowData) => {
                this.setState({selectedService: rowData.ssid});
                return rowData.ssid;
                } }
              defaultValue = {"Please select wifi"}
              options = {this.state.services}
              renderRow = {this._renderDropdownRow.bind(this)}
              onSelect = {this.pickerOnSelect.bind(this)}
            >
         </ModalDropdown>

If there is a call to setState for both of these functions then the dropdown text renders as [object Object]. If I remove the call then the dropdown renders the ssid strings as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions