Skip to content
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

Merged
merged 3 commits into from
Jan 27, 2025
Merged

Conversation

believer
Copy link
Contributor

@believer believer commented Jan 22, 2025

Thanks for this great library!

Due to this change in React Native core getString now returns String?. Since the when condition checks that the current value is a string, I think it's fine to type cast the result as a String. I tested it locally and it resolves the error.

Alternatively, we could go the route of only adding the value if it exists using:

	ReadableType.String -> sizes.getString(i)?.let { result.add(it) }

Copy link

vercel bot commented Jan 22, 2025

@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.

Copy link

codeclimate bot commented Jan 22, 2025

Code Climate has analyzed commit c990fd6 and detected 0 issues on this pull request.

View more on Code Climate.

@believer
Copy link
Contributor Author

@lodev09 Hi! What do you think about these changes to support React Native 0.77?

@lodev09
Copy link
Owner

lodev09 commented Jan 24, 2025

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!

@believer
Copy link
Contributor Author

believer commented Jan 24, 2025

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:

Unnecessary safe call on a non-null receiver of type 'kotlin. String'.

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")

@lodev09
Copy link
Owner

lodev09 commented Jan 24, 2025

Yep, suppress annotation should be fine! Thanks @believer

Copy link
Owner

@lodev09 lodev09 left a 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!

Copy link

vercel bot commented Jan 24, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-native-true-sheet ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 27, 2025 3:55pm

@believer
Copy link
Contributor Author

Awesome, will fix it first thing on Monday!

Copy link
Owner

@lodev09 lodev09 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you!

@lodev09 lodev09 merged commit c6d8b8f into lodev09:main Jan 27, 2025
5 checks passed
@lodev09
Copy link
Owner

lodev09 commented Feb 1, 2025

🚀 This pull request is included in v1.1.0. See Release 1.1.0 for release notes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants