Ok finally my app is running again. One question: ...
# react
i
Ok finally my app is running again. One question: is it possible to get my FC's to not show up as anonymous in react dev tools?
🎉 2
t
Yes, it's possible
😊 1
Do you want automatic solution?
i
manual would be ok, automatic would be better ^^
t
Copy code
operator fun <P: Props> FC<P>.getValue(
    thisRef: Nothing?,
    property: KProperty<*>,
): FC<P> {
    displayName = property.name
    return this
}
Usage:
Copy code
val App by FC<Props> { ... }
❤️ 1
👍 2
p
I was wondering, is there any reason this function is not included in kotlin wrappers ? @turansky
t
Because: 1. It will produce additional runtime (one time
KProperty
) 2. It can be solved via compiler plugin for IR (in future)
👍 1
p
Thanks, that's what I was suspected (for 1). I will therefore wait for the IR plugin.
t
For right now plugin - just idea
I use delegates in my projects
p
Ok good to know. Would the IR plugin propably remove the additional runtime produced by the delegates ? Or just remove the need for delegates to set the component name ?
t
I don’t see delegates in final solution
👍 1
@Paul SOUTEYRAT Looks like “fake delegate” can be effective solution right now - check required
p
By "fake delegate", do you mean delegates with no additional runtime ?
t
Yes
Deleagate, which will not produce
KProperty
p
Ok, is it actually supported (may be through the optimizations of the compiler) ?
t
Magic plugin can do this job
❤️ 1
In any case - check required It’s just theory right now
p
Ok thanks for the info
t
Do you have custom
FC
factories?
p
No, I use the one provided by kotlin-wrappers.
t
What about
VFC
?
Do you use it?
p
I wasn't aware of it, so no, I use FC<Props> instead.
t
Fine time to migrate :)
👍 1
p
Out of curiosity, what does the V of VFC stand for ?
t
Void
👍 1
You can find it in react types
Plugin is under the corner 🙂
K 1