Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6214

Is there a significant difference between React-Native useEffect [] and a custom function inside iOS didFinishLaunchingWithOptions?

$
0
0

I am building a React-Native SDK library based on Swift/Kotlin modules, and I want to deliver the best UX to those, who will use it.

I could not notice how AppDelegate didFinishLaunchingWithOptions is similar to React useEffect, so I've really started to wonder whether we can replicate such behavior inside the JS code.

I did some tests, comparing useEffect inside a core component with a function inside didFinishLaunchingWithOptions, so the only difference I found is:

  • useEffect certainly executes only after the application started, while the iOS function would be executed during startup

I presumed, that useEffect would execute a closure every time the app is opened, but in a core component, it seems to behave the right way.

So how different is creating an SDK initialization inside, for example, useEffect and calling it from where they always put it: didFinishLaunchingWithOptions inside AppDelegate


Viewing all articles
Browse latest Browse all 6214

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>