Comments (1)
The component
method returns a class. You can extend this and add your methods/props or whatever else you need. Setting props will cause the functional component to be recalled.
import { component } from 'haunted';
import { html } from 'lit-html';
function App({ _name }) {
return html`<span>${_name}</span>`;
}
class AppElement extends component(App) {
set name(value) {
this._name = value;
}
}
customElements.define('my-app', AppElement);
from haunted.
Related Issues (20)
- `component()` should accept function with a generic `this` binding that extends HTMLElement HOT 3
- How to annotate return type of custom Haunted hook?
- Upgrading haunted to v2 of lit HOT 5
- Virtual Components can't be conditionally rendered in same part of template HOT 1
- LitHauntedElement: No re-render observed when incoming prop changed HOT 3
- question on potential Redux hooks
- Use Changesets HOT 1
- Consider replacing State and Hook classes with ReactiveController[Host]
- Problem with Haunted 4.8.3 and babel loader HOT 3
- styling example HOT 2
- Context without shadow root HOT 2
- Demos failing on SyntaxError in haunted.js from unpkg HOT 6
- Notify RootPart of disconnect when disconnecting component
- Create component without shadow dom HOT 3
- Haunted not clearing innerHTML before first render HOT 2
- Using useState with generic types
- Infinite loop if effect schedules an update and then throws
- OT: recaptcha haunted js component
- Adopting Stylesheets HOT 3
- Is this repository still active? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from haunted.