React components?
See original GitHub issueHow do you handle React components (=function calls)? You could either have a registry for component names or do this:
class EchoComponent {
···
}
let comp = jsx`<${EchoComponent} />`;
React.renderComponent(comp, document.body);
Issue Analytics
- State:
- Created 8 years ago
- Reactions:2
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Components and Props
Components can refer to other components in their output. This lets us use the same component abstraction for any level of detail. A...
Read more >React Components
Components are independent and reusable bits of code. They serve the same purpose as JavaScript functions, but work in isolation and return HTML....
Read more >Absolutely Awesome React Components & Libraries
Absolutely Awesome React Components & Libraries. This is a list of AWESOME components. Nope, it's NOT a comprehensive list of every React component...
Read more >ReactJS Components
A Component is one of the core building blocks of React. In other words, we can say that every application you will develop...
Read more >MUI: The React component library you always wanted
MUI provides a simple, customizable, and accessible library of React components. Follow your own design system, or start with Material Design.
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 Free
Top 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
@rauschma inspired by your comment: https://github.com/tbranyen/diffhtml/tree/master/packages/diffhtml-components#examples
For anyone looking for a “workaround” for this, I’ve managed to create a proof of concept. Basically, it uses function which returns another function in which we check first letter of tag element. If it’s uppercase, we treat it as component and evaluate that string to variable declaration.
This obviously only works if method is in scope and eval has access to defined variable. Maybe it could be made to work regardless of scope? It seems like this could be properly processed with hyperxify - if first letter is uppercased, don’t stringify tag name and just return original value.
Edit: it seems like proposal on processing has already been implemented in fork of hyperxify; maybe this could be somehow merged to original project?
Or example of a more complex implementation: