-
Notifications
You must be signed in to change notification settings - Fork 15
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 to provide support for handlebar partials ? #3
Comments
@imvetri unfortunately, partials are registered before compiling a template ( |
@danakt Is this on the roadmap? If so, Wondering if you have an idea for how this would work: Say we have // child.handlebars
<div class="child">{{test}}</div>
// parent.handlebars
<div class="parent">
{{#with context}}
{{> child }}
{{/with}}
</div> The 2 ways I can see this being achieved:
// parent.jsx
props => <div class="parent"><div class="child">props.context.test</div></div>
// child.jsx
export default props => <div class="child">props.test</div>;
// parent.jsx
import child from './child';
export default props => <div class="parent"><child {...props.context}/></div>; Happy to help with the implementation of this, thought I would start a discussion for now :) |
@danakt Any thoughts? |
Oh! I apologize for not answering for so long. |
@danakt I have been revisiting this recently. I think It would be straightforward enough to fork |
A partial is a reference to another component, at least when we rewrite it to a react component. The best option would be to modify the path to closely match as its component name or we can pass in a transform function that can rewrite the component name. Here is an example on how it would look like. On the left is a manually rewritten version of HBR to support partial and this gets compiled successfully using the current version of compile. |
I ended up moving away from handlebars on the project I wanted this for. Looks interesting though 👍 |
Thanks for your response |
I'm new to React components, but I saw there is a |
@Rykus0 feel free to tag me if you want to try this out. I'll help as much as I can |
Thank you. I will explore it if I can and let you know if I think I can help
…On Mon, Oct 12, 2020 at 12:01 Vetrivel ***@***.***> wrote:
@Rykus0 <https://github.com/Rykus0> feel free to tag me if you want to
try this out. I'll help as much as I can
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANKGNVUX6MYCUSVFNQLDJDSKMR53ANCNFSM4GO52UIQ>
.
|
No description provided.
The text was updated successfully, but these errors were encountered: