Is there a ChildrenBuilder version of ```public fu...
# react
i
Is there a ChildrenBuilder version of
Copy code
public fun <T : kotlin.Any, P : react.PropsWithRef<T>> forwardRef(handler: react.RBuilder.(P, react.Ref<T>?) -> kotlin.Unit): react.ComponentType<P> { /* compiled code */ }
?
t
In any case you will need
PropsWithRef<*>
If so -
FC
factory method and
props.ref
looks like more elegant solution
Also you can write custom temp adapter for smooth migration
i
Is there any code example with the non-legacy ChildrenBuiolder where forwardref is used? Or are you saying forwardref just doesnt yet exist?
@turansky
If so -
FC
factory method and
props.ref
looks like more elegant solution
Sorry, Neither am I a react expert nor kotlin-js-react I do not know what this means. From what I understand, it is requited to use reacts forwardRef function - am I wrong? I need is some sort of method/function like the one above with generic parameters
T, P
where
P : PropsWithRef<T>
that can be used with
FC<P>
instead of
RBuilder
- right?
t
Example with
ChildrenBuilder
👍 1
But, I suppose, that it can be simpler and without
forwardRef
- check required
cc @Sergei Grishchenko
@iari Could you create issue for this question?
i
@turansky I created this issue: https://github.com/JetBrains/kotlin-wrappers/issues/1347 Just let me know if it's worded properly and asking for the right thing.