[v2] JSX with vhtml.js and async templating
See original GitHub issueThis is a enhancement
Actually I need something like this:
component: {
asyncTemplate: (render) => {
request(...)
.then(html => {
render(html)
})
}
}
There any way to exists this method?
Other idea is allow to return dom elements in .render()
or/and .template()
methods like this:
component: {
render: () => {
return domElement
},
// or
render: domElement
}
This would be awesome because allows developers to uses libs like jsx-dom
or vhtml
and do something beautiful like this:
component: {
render: () => {
return (
<div class="page">
<div class="page-content">
{items.map(item, =>
<div class="whatever"></div>
)}
</div>
</div>
)
},
}
Issue Analytics
- State:
- Created 6 years ago
- Reactions:9
- Comments:17 (8 by maintainers)
Top Results From Across the Web
Using serverside HTML-templates with ReactJS - Stack Overflow
You need to convert JSX to JS (usually done when building your ... Then of course, there's the issue of loading code asynchronously....
Read more >Render Functions & JSX - Vue.js
Render Functions & JSX. Basics. Vue recommends using templates to build your HTML in the vast majority of ... An HTML tag name,...
Read more >How To Create React Elements with JSX - DigitalOcean
JSX is an abstraction that allows you to write HTML-like syntax in your JavaScript ... JSX is the templating language of React elements, ......
Read more >A JSX based html templating engine for browsers or Node ...
A JSX based html templating engine for browsers or Node environments ... components asynchronous and send async requests from within them.
Read more >Iterate Through a JSON Response in JSX Render for React
1async function getRandomUsers() { 2 const res = await ... 3 const data = await res.json(); 4 return data.results; 5}. js.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Agree, there probably could be some kind of babel jsx plugin to understand custom attributes. I see Vue js have their own babel jsx plugin.
But anyway, if you are going to use babel, you can just use es-next templates to achieve almost the same:
Issue is closed because of outdated, irrelevant or not actual
If this issue is still actual and reproducible for latest version of Framework7, please create new issue and fill the issue template correctly: