私は関数を渡すいくつかのコンポーネントを持っていると言います。反応ネイティブでの関数の使用の違い
export default class SomeComp extends Component {
constructor(props) {
super(props);
}
_someFunc =() => {
return ...
}
render() {
return (
<View
onLayout={this._someFunc()}
/>
OR onLayout={this._someFunc()}
とonLayout={() => {this._someFunc()}}
の違いがある
<View
onLayout={() => {this._someFunc()}}
/>
)
}
}
?
あなたは 'onLayout = {this._someFunc}'と 'onLayout = {()=> {this._someFunc()}}'の違いを意味しましたか? – bennygenel
@bennygenel。 Q:Q: – Stophface
の最後の文で述べたように、あなたはそうしませんでした。まず、 'onLayout = {this._someFunc()}'と 'onLayout = {this._someFunc}'の違いがあります。 – bennygenel