-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Android] Can we allow views accept Context? (not ThemedReactContext) #5053
Comments
Hey deminoth, thanks for reporting this issue! React Native, as you've probably heard, is getting really popular and truth is we're getting a bit overwhelmed by the activity surrounding it. There are just too many issues for us to manage properly.
|
You shouldn't store a reference to your activity, and instead pass the |
Nevermind, just saw the constructor for |
We can probably change the signature of |
Summary: facebook#5053 Closes facebook#5125 Reviewed By: svcscm Differential Revision: D2807202 Pulled By: foghina fb-gh-sync-id: 1e268c940a08aa7bf243971ba91d4595973f12af
I've made a RN android app with the YouTube Android Player API. In the API,
YouTubePlayerView
constructor requiresYouTubeBaseActivity
as a context parameter. My native module is like below:But when the RN drop this view, it notify view manager with
onDropViewInstance
,and it shows the redbox
...MainActivity cannot be cast to com.facebook.react.uimanager.ThemedReactContext
.I'm applying a workaround by checking
view.getContext() instanceof ThemedReactContext
. Is it only my problem? Or can we allowContext
as a constructor parameter of views? Any other suggestions?The text was updated successfully, but these errors were encountered: