-
-
Notifications
You must be signed in to change notification settings - Fork 66
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
Support new arch #185
Support new arch #185
Conversation
ed058ee
to
8057c35
Compare
8c4d17c
to
a0b3e5d
Compare
a0b3e5d
to
cca9d77
Compare
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.
Janic this is just amazing. Only a minor nitpick, which I can fix later - otherwise this is great - I just ran it on my end and all works!
Thanks so much for this, LGTM ❤️
|
||
@objc var resizeMode: NSString { | ||
get { | ||
convertContentMode(resizeMode: blurhashView.contentMode) |
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.
We could simply extend the ContentMode
type to add a jsValue
or stringRepresentation
or something like that - but let's leave it like this for now.
private final func convertResizeMode(resizeMode: NSString) -> ContentMode { | ||
switch resizeMode { | ||
case "contain": | ||
return .scaleAspectFit | ||
case "cover": | ||
return .scaleAspectFill | ||
case "stretch": | ||
return .scaleToFill | ||
case "center": | ||
return .center | ||
default: | ||
return .scaleAspectFill | ||
} | ||
} |
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.
Could also be a convenience init instead of a separate func here
This updates the example app to RN 0.73 then adds support for new arch. I did a best effort at keeping backwards compat but it might introduce some issues with older RN version, could use more testing.