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
accept props #1
Comments
Could also be cool to be able to pass them as properties on the container element (or the |
@rdmurphy I actually thought of data attributes. but found a JSON config to look more neat after looking at the following options:
or
I'm open to suggestions Namespace idea is KOOL! I love it |
V1.0.0 or higher now support props 🎉 |
@zouhir can we make it possible to pass props from the render call? |
@luisrudge in this version, what you can do in a case where you want to render widget with extra props:
that what works now out of the box, will consider allowing passing hope my answer was helpful |
That makes sense. Thanks! |
I'd totally love it if props could include functions. Could do: <script type="text/props">
window.widgetVariable = {
props: {
videoId: '11223300',
playFromStart: true,
onPlay: function () {
console.log('played!')
}
}
}
</script> Then we could delete My use case is with downshift, I'd love to be able to expose the full API and allow you to render whatever you'd like using whatever framework you want 😄 Need a full function to do that though... |
That idea is so damn awesome. Oh! @kentcdodds would you like me to allow you expose DOM events? your users can do: You can do:
did I misunderstand please let me know! |
Yeah, that'd be pretty legit 👍 That'd definitely allow me to do what I want to do here! 🎉 |
Hello, I also would like to pass functions to a widget. From reading this thread I assume you already did implement the exposing of DOM events? However, I cannot find anything like Can anyone provide an example of passing functions/using events across parent and child/widget components? |
it's good to be able to pass props in widget configs
example: if we have a video player widget - would be great if the client\host DOM can pass props within the JSON config like what we already have in
{ "clone": "id-xyz" }
but:The text was updated successfully, but these errors were encountered: