question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pressable component missing focused argument

See original GitHub issue

The latest release has removed focused argument from the children rendering function children({pressed, focused}) This has resulted in breaking changes

New code

    <View
      {...restPropsWithDefaults}
      {...eventHandlers}
      ref={viewRef}
      isTVSelectable={isTVSelectable !== false && accessible !== false}
      style={typeof style === 'function' ? style({pressed}) : style}
      collapsable={false}>
      {typeof children === 'function' ? children({pressed}) : children}
      {__DEV__ ? <PressabilityDebugView color="red" hitSlop={hitSlop} /> : null}
    </View>
  );

Old Code

    <View
      {...restProps}
      {...eventHandlers}
      {...android_rippleConfig?.viewProps}
      accessible={accessible !== false}
      focusable={focusable !== false}
      isTVSelectable={isTVSelectable !== false && accessible !== false}
      hitSlop={hitSlop}
      ref={viewRef}
      style={typeof style === 'function' ? style({pressed, focused}) : style}>
      {typeof children === 'function' ? children({pressed, focused}) : children}
      {__DEV__ ? <PressabilityDebugView color="red" hitSlop={hitSlop} /> : null}
    </View>
  );

React Native version:

Run react-native info in your terminal and copy the results here. System: OS: macOS 11.5.1 CPU: (12) x64 Intel® Core™ i7-9750H CPU @ 2.60GHz Memory: 18.43 MB / 16.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 12.13.1 - /var/folders/dm/zvvyvl9j6835rtc6f676rk3xplzggv/T/yarn–1628248979426-0.764699714281925/node Yarn: 1.22.10 - /var/folders/dm/zvvyvl9j6835rtc6f676rk3xplzggv/T/yarn–1628248979426-0.764699714281925/yarn npm: 7.6.0 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman Managers: CocoaPods: 1.10.2 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4 Android SDK: API Levels: 22, 23, 25, 26, 27, 28, 29 Build Tools: 19.1.0, 20.0.0, 25.0.0, 27.0.3, 28.0.3, 29.0.2, 29.0.3 System Images: android-22 | Android TV Intel x86 Atom, android-24 | Intel x86 Atom_64, android-24 | Google APIs Intel x86 Atom_64, android-28 | Android TV Intel x86 Atom, android-28 | Google APIs Intel x86 Atom_64, android-28 | Google Play Intel x86 Atom, android-29 | Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom, android-Q | Android TV Intel x86 Atom Android NDK: 19.2.5345600 IDEs: Android Studio: 2020.3 AI-203.7717.56.2031.7583922 Xcode: 12.5.1/12E507 - /usr/bin/xcodebuild Languages: Java: 1.8.0_212 - /Library/Java/JavaVirtualMachines/jdk1.8.0_212.jdk/Contents/Home/bin/javac npmPackages: @react-native-community/cli: Not Found react: ^17.0.2 => 17.0.2 react-native: Not Found react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
prakashjais99commented, Aug 7, 2021

@douglowder thanks for the quick fix.

0reactions
douglowdercommented, Aug 7, 2021

Fix is in release 0.64.2-2. Closing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pressable - React Native
Pressable is a Core Component wrapper that can detect various stages of press interactions on any of its defined children.
Read more >
React.js - input losing focus when rerendering - Stack Overflow
The loss of focus happens because the component prop uses React.createElement each time instead of just re-rendering the changes.
Read more >
View - Android Developers
This widget is merely a simple wrapper around a long-press handler. ... To force focus to a specific view, call requestFocus() . Set...
Read more >
SAP message L4705 Argument & & & & is missing in the ta
SAP has defined this message as 'self-explanatory' and therefore, has not provided any further details for it. All messages in SAP have a...
Read more >
Philosophies | Free Full-Text | A Hobbesian Argument for World ...
Thomas Hobbes' political philosophy provides a clear description of why government is necessary, as human nature and the structures emerging out of human...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found