我正在尝试将风格传递给孩子,我的代码是:
render() {
const RotateData = this.RotateValueHolder.interpolate({
inputRange: [0, 1],
outputRange: ['0deg', '360deg']
});
Object.assign(this.props.children.props.style,{'transform': [{'rotate': RotateData}] });
return (
<View style={{flex:1}}>
{this.props.children}
</View>
);
}
我收到此错误:
Invariant Violation: Transform with key of "rotate" must be a string:
{"rotate":"0deg"}