Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions packages/react-native/Libraries/Blob/URL.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ export class URL {
// $FlowFixMe[missing-local-annot]
constructor(url: string, base?: string | URL) {
let baseUrl = null;
// $FlowFixMe[sketchy-null-string]
if (!base || validateBaseUrl(url)) {
if (base == null || base === '' || validateBaseUrl(url)) {
this._url = url;
if (this._url.includes('#')) {
const split = this._url.split('#');
Expand Down
3 changes: 1 addition & 2 deletions packages/react-native/Libraries/Components/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,7 @@ const Button: component(
accessibilityActions={accessibilityActions}
onAccessibilityAction={onAccessibilityAction}
accessibilityLabel={
// $FlowFixMe[sketchy-null-string]
ariaLabel || accessibilityLabel
ariaLabel != null && ariaLabel !== '' ? ariaLabel : accessibilityLabel
}
accessibilityHint={accessibilityHint}
accessibilityLanguage={accessibilityLanguage}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1586,8 +1586,8 @@ class ScrollView extends React.Component<ScrollViewProps, ScrollViewState> {
// then the second tap goes to the actual interior view)
const {keyboardShouldPersistTaps} = this.props;
const keyboardNeverPersistTaps =
// $FlowFixMe[sketchy-null-bool]
!keyboardShouldPersistTaps || keyboardShouldPersistTaps === 'never';
keyboardShouldPersistTaps == null ||
keyboardShouldPersistTaps === 'never';

if (typeof e.target === 'number') {
if (__DEV__) {
Expand Down Expand Up @@ -1669,8 +1669,8 @@ class ScrollView extends React.Component<ScrollViewProps, ScrollViewState> {

const {keyboardShouldPersistTaps} = this.props;
const keyboardNeverPersistsTaps =
// $FlowFixMe[sketchy-null-bool]
!keyboardShouldPersistTaps || keyboardShouldPersistTaps === 'never';
keyboardShouldPersistTaps == null ||
keyboardShouldPersistTaps === 'never';

// Dismiss the keyboard now if we didn't become responder in capture phase
// to eat presses, but still want to dismiss on interaction.
Expand Down
8 changes: 6 additions & 2 deletions packages/rn-tester/js/examples/Pressable/PressableExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,12 @@ function ForceTouchExample() {
style={styles.wrapper}
testID="pressable_3dtouch_button"
onStartShouldSetResponder={() => true}
// $FlowFixMe[sketchy-null-number]
onResponderMove={event => setForce(event.nativeEvent?.force || 1)}
onResponderMove={event => {
const touchForce = event.nativeEvent?.force;
setForce(
touchForce != null && Boolean(touchForce) ? touchForce : 1,
);
}}
onResponderRelease={event => setForce(0)}>
<Text style={styles.button}>Press Me</Text>
</View>
Expand Down
3 changes: 1 addition & 2 deletions packages/rn-tester/js/utils/useJsStalls.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ const useJsStalls = (): ({
onStall: ({busyTime}) =>
setStallsState(state => {
// If previous interval was cleared
// $FlowFixMe[sketchy-null-number]
if (!state.stallIntervalId) {
if (!Boolean(state.stallIntervalId)) {
return state;
}

Expand Down
Loading