Hi! I wanted to build a reusable component, now I ...
# react
c
Hi! I wanted to build a reusable component, now I have this inside a custom FC<>:
Copy code
props.detailComponent(id)
That's the part inside the Props interface:
Copy code
var detailComponent: (id: Int?) -> Unit
And thats the prop definition inside the calling FC<>:
Copy code
detailComponent = { id ->
            div {
                +"asfsagsd $id"
            }
        }
Simplified, since the more complex real thing didn't work Problem is, the div won't render - I suppose I can't just inject elements this way. How do I do it the right way? Thanks in advance!
t
Looks like you need render function instead
c
@turansky you mean as in using Component classes instead of functional components? I can't find a solution doing that ambiguously.
t
renderOption
as example from Autocomplete