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.

External usage of function "onCancel"

See original GitHub issue

Hi, My app activity depends on connection status. I tried to hide DateTimePicker when it is disconnected but it doesn’t seem to work (when I put the code to render, picker is still visible, app ends up with infinite loop and crashes after while):

if (this.props.connectionStatus === config.connectionStatus.DISCONNECTED) {
   this._hideDateTimePicker;
}

So my other idea is to programmatically use onCancel function so it could be triggered when app state changes. Something like:

if (this.props.connectionStatus === config.connectionStatus.DISCONNECTED) {
   this."functionThatUsesOnClose"();
}

Is there any way to do that? Thank you in advance for reply!

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
vasyl91commented, Sep 21, 2018

Not good 😭 I’ll request them then. Thank you for your reply!

0reactions
mmazzarolocommented, Sep 21, 2018

Ouch, you’re in a bad luck then.
The Android DatePicker and TimePicker don’t have a programmatic “hide” support (so we can’t do much here 😞 ).
I guess you could try making a feature request directly to the React Native repo.

(Sorry if I didn’t understand your issue before)

Read more comments on GitHub >

github_iconTop Results From Across the Web

JavaScript Events Handlers— onfocus, oncancel, and ...
The onfocus property of the document object lets us set an event handler for the focus event. We can use it to check...
Read more >
How can I pass an argument to onCancel from {...bind} using ...
So, I thought to remove onClick={() => start(preset)} from the button and call start(preset) from shortPress function. But how can I pass the ......
Read more >
Server-Side Design - Win32 apps - Microsoft Learn
Server-side functions communicate with the client wizard through the windows.external object. Server-side script provides these functions to ...
Read more >
How to use the react-fela.withTheme function in react-fela | Snyk
withTheme examples, based on popular ways it is used in public projects. ... rightButtons, className, subtitle, onClose, onCancel, okText, cancelText, onOk, ...
Read more >
suspendCancellableCoroutine - Kotlin
A typical use of this function is to suspend a coroutine while waiting for a ... an external API must be thread-safe, because...
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