-
Notifications
You must be signed in to change notification settings - Fork 206
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
html/es6 in attributes #209
Comments
I'm not sure because it's something I rarely use: <Modal>
<rt-template prop="footer">
<Button onClick={this.handleCancel}>custom cancel</Button>
</rt-template>
<p>modal content...</p>
</Modal> If you try it, can you please tell if it's actually working for your use case (with |
unfortunately your idea is not working for my case: |
I think the problem is in Would you please try this ugly hack (just to see if it works): <Modal rt-props="{footer: f1.bind(this)()}">
<rt-template prop="f">
<Button onClick={this.handleCancel}>custom cancel</Button>
</rt-template>
<p>modal content...</p>
</Modal> BTW, I remember I suggested a possible improvement long ago, but no discussion followed. See #103, #150 and #155. |
Thanks! That did the trick ;) |
@TimKraemer yes of course I wouldn't advise to use it in any project, it was just to check if it could work at least in theory. Which it is, so perhaps we can add this functionality easily in the future. Regarding the "1": when you have What I've done simply is creating a var templateRT = function () {
function f1() {
return React.createElement(Button, { 'onClick': this.handleCancel }, 'custom cancel');
}
return React.createElement(Modal, _.assign({}, { 'f': f1.bind(this) }, { footer: f1.bind(this)() }), React.createElement('p', {}, 'modal content...'));
}; |
Hi, thanks for the great project!
I'm using ant-design for my project, they're using HTML/ES6 inside attributes in some of their components. For example this one:
I wonder if there's a way to make this work with react-templates?
Thanks!
The text was updated successfully, but these errors were encountered: