-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
fix(android): support react native 0.77 #117
Conversation
@believer is attempting to deploy a commit to the Jovanni's projects Team on Vercel. A member of the Team first needs to authorize it. |
Code Climate has analyzed commit c990fd6 and detected 0 issues on this pull request. View more on Code Climate. |
@lodev09 Hi! What do you think about these changes to support React Native 0.77? |
Hey @believer, thanks for the PR. I would prefer null check instead of casting. I'm not sure if this will cause compile issue on older RN version tho. Thanks! |
Changed it to a null check instead, I agree that it's cleaner. I doesn't seem to cause a compile error, but it displays a warning:
We could suppress the warning if we feel like it: // React Native < 0.77 used String for getString, but 0.77
// changed it to String?. Suppress the error for older APIs.
@Suppress("UNNECESSARY_SAFE_CALL") |
Yep, suppress annotation should be fine! Thanks @believer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Goods 👍
Just add the suppress annotation when you can. Thanks!
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Awesome, will fix it first thing on Monday! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you!
🚀 This pull request is included in v1.1.0. See Release 1.1.0 for release notes. |
Thanks for this great library!
Due to this change in React Native core
getString
now returnsString?
. Since thewhen
condition checks that the current value is a string, I think it's fine to type cast the result as aString
. I tested it locally and it resolves the error.Alternatively, we could go the route of only adding the value if it exists using: