question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to use "Component"-Elements

See original GitHub issue

Hi,

I am upgrading my project to the current kotlin-react version and having trouble to migrate a piece of code, where I am using an external library.

Old code:

@file:JsModule("react-select")
@file:JsNonModule

[...]

@JsName("default")
external class RSelect : Component<RSelectProps, RSelectState> {
    override fun render(): ReactElement<RSelectProps>?
}
fun RBuilder.rSelect(handler: RSelectProps.() -> Unit) = child<RSelectProps, RSelect> {
    attrs {
        handler()
    }
}

Is there a way to use Components within ChildrenBuilder?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
turanskycommented, Sep 23, 2022

R prefix is redundant in declarations Common recomendation - use original names where it’s possible

0reactions
h-mergelcommented, Oct 26, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

React Components, Elements, and Instances – React Blog
Why introduce elements? In this traditional UI model, it is up to you to take care of creating and destroying child component instances....
Read more >
Components Basics - Vue.js
Components allow us to split the UI into independent and reusable pieces, and think about each piece in isolation. It's common for an...
Read more >
Web Components - MDN Web Docs - Mozilla
A guide showing how to use the features of custom elements to create simple web components, as well as looking into lifecycle callbacks...
Read more >
Dynamic Vue.js Components with the component element
You can dynamically switch between components in a template by using the reserved <component> element and dynamically bind to its is attribute.
Read more >
Guide to components in Figma
You can create components to use within a single file. Or, you can use team library to share components and styles across files...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found