choojs / nanocomponent-adapters

🔌 - Convert a nanocomponent to a component for your favourite API or library (web components, (p)react, angular)
MIT License
96 stars 17 forks source link

react: extend React.Component, closes #13 #15

Closed goto-bus-stop closed 6 years ago

goto-bus-stop commented 7 years ago

Instead of using createClass, extend React.Component.

This makes the React adapter identical to the Preact one, since Preact is API compatible with React core.

I changed the preact adapter to refer to the react adapter, which works, but the assert messages will read nanocomponent-adapters/react when using the preact adapter. I can revert that if y'all think it's an issue. or the preact adapter could be removed entirely and the docs updated to explain that the react adapter can be used with preact as well.

toddself commented 7 years ago

I think just saying you can use the React one with the Preact one might be the best option here.

goto-bus-stop commented 6 years ago

Yeah, agreed. collapsed the react and preact sections into one. Also removed preact.js entirely, which does make it a breaking change!

yoshuawuyts commented 6 years ago

I'm cool with breaking changes on this module given it's still a bit experimental. Neato changes! - Would this be good to merge, or is there more that needs to happen? Thanks!

On Tue, Sep 12, 2017 at 2:03 PM Renée Kooi notifications@github.com wrote:

Yeah, agreed. collapsed the react and preact sections into one. Also removed preact.js entirely, which does make it a breaking change!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/choojs/nanocomponent-adapters/pull/15#issuecomment-328831844, or mute the thread https://github.com/notifications/unsubscribe-auth/ACWlepzFMADlZI9SeULTfL9DM-z9Ws-wks5shnMTgaJpZM4PIsZH .

goto-bus-stop commented 6 years ago

Good to go from my manual tests!