mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Remove accidental ref callback return values (#57849)
Summary: Pull Request resolved: https://github.com/react/react-native/pull/57849 Ref callbacks commonly used expression bodies that returned assignment or collection method results. Use block bodies so these callbacks return `void`, matching React's ref contract. Changelog: [Internal] - Make callback refs return `void` explicitly. Reviewed By: SamChou19815 Differential Revision: D115064073 fbshipit-source-id: ad8fcdb1a94421a700e958c6e4ae981bf350d1ed
This commit is contained in:
1 parent
8ac3e2fa58
commit
2ce2c0794b
2 files changed
+6
-2
No files matched your search
@@ -563,7 +563,9 @@ class SelectionExample extends React.Component<
|
||||
onChangeText={value => this.setState({value})}
|
||||
// $FlowFixMe[method-unbinding] added when improving typing for this parameters
|
||||
onSelectionChange={this.onSelectionChange.bind(this)}
|
||||
ref={textInput => (this._textInput = textInput)}
|
||||
ref={textInput => {
|
||||
this._textInput = textInput;
|
||||
}}
|
||||
selection={this.props.imperative ? undefined : this.state.selection}
|
||||
style={this.props.style}
|
||||
value={this.state.value}
|
||||
|
||||
@@ -297,7 +297,9 @@ class IntervalExample extends React.Component<
|
||||
return (
|
||||
<View>
|
||||
<TimerTester
|
||||
ref={ref => (this._timerTester = ref)}
|
||||
ref={ref => {
|
||||
this._timerTester = ref;
|
||||
}}
|
||||
dt={25}
|
||||
type="setInterval"
|
||||
/>
|
||||
|
||||
Reference in new issue
Block a user