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

Use ComponentClass instead of RClass #570

Merged
merged 2 commits into from
Jul 24, 2021
Merged

Use ComponentClass instead of RClass #570

merged 2 commits into from
Jul 24, 2021

Conversation

aerialist7
Copy link
Contributor

@Leonya Leonya merged commit 8c21993 into JetBrains:master Jul 24, 2021
@@ -3,8 +3,8 @@ package react.router.dom
import react.*
import kotlin.reflect.KClass

fun <P : RProps> withRouter(klazz: KClass<out Component<P, *>>): RClass<P> =
fun <P : RProps> withRouter(klazz: KClass<out Component<P, *>>): ComponentClass<P> =
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we need some analysis for these changes. For example, it seems we should use ComponentType here because we should not know how withRouter HOC implemented. It can return FunctionComponent under the hood, but we are saying that it is Class. I recommend use ComponentType everywhere it is possible in libraries for returned types and use ComponentClass only if it is really needed.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like next PR (check required before)

@aerialist7 aerialist7 deleted the kotlin-react branch July 25, 2021 17:38
@Leonya
Copy link
Collaborator

Leonya commented Jul 26, 2021

Released in pre.222

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.

4 participants