Deprecation Warnings

I started seeing 2 warnings repeat when starting the player today. I’m currently using "@amzn/react-native-kepler": "~2.0.0", and looking trough the documentation I for KeplerAppState and useComponentInstance I seem to be following the documented pattern. Also when searching the module I don’t see addAppStateListener or getComponentInstance. Is there any clarification for these warnings?

useAddKeplerAppStateListenerCallback is deprecated. Update to use addAppStateListener from KeplerAppStateManager instead. useAddKeplerAppStateListenerCallback will be removed in a future release

and

useComponentInstance is deprecated. Update to use getComponentInstance from KeplerAppStateManager instead. useComponentInstance will be removed in a future release

App Name: Philo
App Link on Amazon Appstore https://www.amazon.com/PHILO-Philo-Live-On-Demand-TV/dp/B07BKPFXTJ

1 Like

Hi @Tony ,

Thanks for reporting this.
Our team will get back on this soon.

Thanks,
Rohit

Hi @Tony ,

The API you are using has been deprecated. Our team has recommended to use the below instead :

Use getComponentInstance from KeplerAppStateManager instead

Meanwhile, our team is working to get the document updated.

Thanks,
Rohit

That’s the issue I don’t see KeplerAppStateManager available from @amzn/react-native-kepler is there a newer versions I should be on which supports that?

Hi @Tony ,

Our team is working to make this available.
We will update you soon on this.

Thanks,
Rohit

SO frustrating. What we are supposed to switch to to avoid the deprecation needs to be available when the deprecation is announced so we can switch. I’ll never remember to check for availability of the getComponentInstance() call at the same time the useComponentInstance() is deprecated. I just posted about this in the feature request section if they allow it: this is not cool behavior Amazon. “Oh by the way this is being deprecated use someCall() instead.” But someCall() is not available. !!!

2 Likes

I complained about this here as well: https://community.amazondeveloper.com/t/frustration-with-deprecation-of-functions-or-features-without-notice/20184

Thanks Matthew, we regret the confusion and frustration created.

This has been worked on by our team for some time and I have escalated this to have this updated as soon as possible.

Thanks,
Rohit

Hey team. @Amz_Rsk
Any updates ? Do we have another way to avoid this problem?
Tried:

useKeplerAppStateManager instead of useAddKeplerAppStateListenerCallback

But faced with same error:

 (NOBRIDGE) ERROR  TypeError: KeplerAppStateManagerSpec_1.default.addEventListener is not a function (it is undefined)

This error is located at:
    in ApplicationState (created by App)
    in Unknown (created by App)
    in RCTView (created by View)
    in View
    in Unknown
    in Unknown (created by App)
    in LocalizeProvider (created by TranslationProvider)
    in TranslationProvider (created by App)
    in ApolloProvider (created by SlingStoreProvider)
    in SlingStoreProvider (created by App)
    in PersistGate (created by SlingStoreProvider)
    in Provider (created by SlingStoreProvider)
    in SlingStoreProvider (created by App)
    in App
    in RCTView (created by View)
    in View (created by AppContainer)
    in RCTView (created by View)
    in View (created by AppContainer)
    in AppContainer
    in com.sling.main(RootComponent), js engine: hermes

Thanks,
Vlad

Seeing the same issue, here, trying to implement useKeplerAppStateManager using the documentation, and even the exact comprehensive example app from the documentation, and getting

‘“@amznamzn/react-native-kepler”’ has no exported member named ‘useKeplerAppStateManager’

with

"@amzn/react-native-kepler": "~2.0.0",

in package.json

Is it still the case that useComponentInstance is deprecated, but it’s replacement getComponentInstance from KeplerAppStateManager is not available?