Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix Bug] Choice option not change when the component triggering by other component dynamically. #8

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

home3k
Copy link

@home3k home3k commented Aug 4, 2016

    componentWillReceiveProps(nextProps) {
        this._updateSelectedOptions(nextProps.selectedOptions);
        this.setState({
            disabled: nextProps.disabled
        });
    }
    _updateSelectedOptions(selectedOptions) {
        this.setState({
            selectedOptions,
            dataSource: this.ds.cloneWithRows(this.props.options)
        });
    }

The dataSource not change when nextProps.options changed.

        this._updateSelectedOptions(nextProps.selectedOptions, nextProps.options);
        this.setState({
            selectedOptions,
            dataSource: options ? this.ds.cloneWithRows(options) : this.ds.cloneWithRows(this.props.options)
        });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant