【发布时间】:2023-04-10 00:56:01
【问题描述】:
我总是将 this 解包,以便渲染函数看起来更整洁。这样做是不好的做法吗?
示例:
class Zoom extends React.Component {
// ...
render() {
const {view, zoomOutScreen} = this;
const {navigation} = this.props;
return (
<Wrapper
innerRef={view}
animation='zoomIn'
duration={200}
useNativeDriver={true}
>
<Component
navigation={navigation}
zoomOutScreen={zoomOutScreen}
/>
</Wrapper>
);
}
}
【问题讨论】:
标签: javascript reactjs react-native ecmascript-6