-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
查看源码:
this.state = { rating: props.rating || 0 };
你将props数据赋值在state上,造成不能辩护;
请更新代码
`render() {
let extraProps = this.props.viewOnly ? {} : this.panResponder.panHandlers;
return (
<View
onLayout={event => {
const layout = event.nativeEvent.layout;
this.viewX = layout.x;
}}
style={{ flexDirection: 'row' }}
{...extraProps}
>
// {this._getStars(this.state.rating)}
{this._getStars(this.props.rating)}
</View>
);
}`
Metadata
Metadata
Assignees
Labels
No labels