Closed bcomnes closed 7 years ago
These are also minimally untested. Good luck!
@bcomnes I may be wrong here, but the way I'm reading the react adapter, it would only work for one use, i.e.
var ReactButton = toReact(Button, react)
ReactDOM.render(<ReactButton />, node) // works
ReactDOM.render(<div><ReactButton /><ReactButton /></div>, node) // what about this?
My guess is that it would be using the same nanocomponent instance, and sharing props
, node
, etc. as well. Forgive me for not just trying it but I'm on-the-go and wanted to point this out in case it's time-sensitive.
Perhaps the solution (if this indeed a problem) is to put things like var comp = new Component()
inside react's constructor
method?
I was looking at that too, and I believe you are right, although this problems appears to be an issue with the existing version as well.
Going to merge this for now. I think I addressed @timwis's points. I want to revisit the Preact and Angular 2 example: https://github.com/choojs/nanocomponent-adapters/pull/6 soonish
I'll release these as 2.0.0 and we can iterate with patches and minor bumps for a bit.
I had to remove the custom element one because it didn’t work and I don’t have time to fix it. Please, someone add this back!