Hacker News new | ask | show | jobs
by sibit 1509 days ago
> To pass a prop to a component in a modular way, you have to pass a string attribute

Is this actually how people pass props with Web Components? I've only used web components for a few years but I've always created a new instance of the class and I pass props using the constructor like:

`${new ExampleComponent(props)}`

Then in the constructor it's just this.state = {...this.state, ...props}