Open cncolder opened 7 years ago
Do you want to request a feature or report a bug (建议还是bug) ? bug
What is the current behavior? (现有状况) https://github.com/weui/react-weui/blob/master/src/components/tab/tab.js#L38 Can't change defaultIndex after first render.
What is the expected behavior? (应有状况) Update this.state.index after receive new props.
this.state.index
componentWillReceiveProps(nextProps) { if (this.props.defaultIndex != nextProps.defaultIndex) { this.setState({index: nextProps.defaultIndex}) } }
Which versions of React-weui, weui, and which OS and device are affected by this issue? (React-weui版本 weui版本 机型和系统) react-weui@1.0.3, weui@1.1.0, all.
有遇到这个问题 可以发个pr吗
@n7best pr发到这里还是你的fork?
这里就好了
Searchbar组件也有这个问题,是团队遗漏了还是有什么特殊的考虑呢?
Do you want to request a feature or report a bug (建议还是bug) ? bug
What is the current behavior? (现有状况) https://github.com/weui/react-weui/blob/master/src/components/tab/tab.js#L38 Can't change defaultIndex after first render.
What is the expected behavior? (应有状况) Update
this.state.index
after receive new props.Which versions of React-weui, weui, and which OS and device are affected by this issue? (React-weui版本 weui版本 机型和系统) react-weui@1.0.3, weui@1.1.0, all.