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

[core][Android] View-related DSL functions do not require providing the view's type in function parameters #20751

Conversation

lukmccall
Copy link
Contributor

Why

DSL Functions related to views don't require specificating the view type anymore.

How

Before:

View(ExpoImageViewWrapper::class) {
	Prop("source") { view: ExpoImageViewWrapper, sources: List<SourceMap>? ->
		view.sources = sources ?: emptyList()
	}
	
	Prop("contentFit") { view: ExpoImageViewWrapper, contentFit: ContentFit? ->
		view.contentFit = contentFit ?: ContentFit.Cover
	}

	...
}

After:

View(ExpoImageViewWrapper::class) {
	Prop("source") { view, sources: List<SourceMap>? ->
		view.sources = sources ?: emptyList()
	}
	
	Prop("contentFit") { view, contentFit: ContentFit? ->
		view.contentFit = contentFit ?: ContentFit.Cover
	}
    
	...
}

Test Plan

  • bare-expo ✅

@expo-bot expo-bot added the bot: suggestions ExpoBot has some suggestions label Jan 9, 2023
lukmccall and others added 2 commits January 10, 2023 11:19
Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com>
@lukmccall lukmccall merged commit 2d4457c into main Jan 10, 2023
@lukmccall lukmccall deleted the @lukmccall/core/view-definition-does-not-requiered-view-type-anymore branch January 10, 2023 10:21
@expo-bot expo-bot added bot: passed checks ExpoBot has nothing to complain about and removed bot: suggestions ExpoBot has some suggestions labels Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: passed checks ExpoBot has nothing to complain about
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants