-
Notifications
You must be signed in to change notification settings - Fork 27
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
How do we use custom elements? #54
Comments
Ah, looks like we can basically just use So element('some-element')({class: 'foo'}, [...children]) That should cover most cases, but there might still be special cases like with I'm not sure if this is any better, but maybe all args can be in one function call: element('some-element', {class: 'foo'}, [...children]) |
Hello @trusktr. You've almost figured it all out by yourself 😄 The
You currently can't give a child. But you can give a second argument. This is what it looks like: const myButton = element("button", {style: {border: "1px solid black"}});
// use the button like this
myButton({style: {background: "blue"}}, "Click me"); Here the initial We may consider also allowing a third argument. But the idea is that
What sort of special case are you thinking of? |
How would I use a custom element named
some-element
in Turbine?The text was updated successfully, but these errors were encountered: