-
Notifications
You must be signed in to change notification settings - Fork 161
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
Prepare Component Props for more strict restrictions #602
Conversation
@@ -13,8 +13,8 @@ external interface QueryErrorResetBoundaryValue { | |||
|
|||
external val useQueryErrorResetBoundary: () -> QueryErrorResetBoundaryValue | |||
|
|||
external interface QueryErrorResetBoundaryProps : react.RProps { | |||
var children: dynamic | |||
external interface QueryErrorResetBoundaryProps : react.Props { |
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.
PropsWithChildren
? I will fix it in generator
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.
https://react-query.tanstack.com/reference/QueryErrorResetBoundary
There should be render children, not Array<ReactNode>
@@ -16,10 +16,6 @@ abstract class RComponent<P : RProps, S : State> : Component<P, S> { | |||
// if you use this method, don't forget to pass props to the constructor first | |||
open fun S.init(props: P) {} | |||
|
|||
fun RBuilder.children() { |
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.
Redundant?
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.
Yea, there is context(RBuilder) PropsWithChildren.children()
, this declaration in more obvious, it is impossible to declare such method in RComponent
because we don't know will inheritor implements PropsWithChildren
or not
external interface QueryErrorResetBoundaryProps : react.RProps { | ||
var children: dynamic | ||
external interface QueryErrorResetBoundaryProps : react.Props { | ||
var children: dynamic |
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.
Лишний пробел
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.
I will regenerate react-query
wrappers after this PR
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.
Fixed anyway
Released in pre.228 |
There are typing vulnerability of currents props: every component now can have children with type
Array<ReactNode>
, even it is not declared obviously. Also there is conflict of names and now there are difficulties with creation of children with custom type (e.g. render children)This PR - first step to make
Props
more strict.TS typings
Part of #358
cc @turansky @aerialist7