yoshuawuyts / microcomponent

Smol event based component library
MIT License
35 stars 11 forks source link

Component not mounted again on route change in choo #22

Open dbtek opened 7 years ago

dbtek commented 7 years ago

I am experimenting microcomponent with choo. Not sure whether I am missing something or not. However, a component inside a route is not visible after one or more route changes.

Reproduce

rafaismyname commented 7 years ago

hey @yoshuawuyts, sorry to bother... but any suggestions on this?

best!

rafaismyname commented 7 years ago

@dbtek seems like an issue with nanocomponent... When a new view is rendered, nanocomponent's _element is not being unloaded causing nanomorph to not rerender the component itself...

a "hotfix" for this, (that worked for me, by now...) would be:

function createComponent () {
  var component = microcomponent({
    name: 'plaincomponent'
  })
[...]
  function unload () {
    this._element = null;
  }
}

best

dbtek commented 7 years ago

@rafaelamorim Thanks for workaround. I'll try it!

yoshuawuyts commented 7 years ago

We released a new version of nanocomponent yesterday (nanocomponent@next) - it's got a slightly different API, but we've tried solving all issues that were plaguing previous versions - perhaps you could give that a try? Cheers!

On Wed, Jul 19, 2017 at 10:28 AM İsmail Demirbilek notifications@github.com wrote:

@rafaelamorim https://github.com/rafaelamorim Thanks for workaround. I'll try it!

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/yoshuawuyts/microcomponent/issues/22#issuecomment-316312004, or mute the thread https://github.com/notifications/unsubscribe-auth/ACWleh4naxTUNON8DKPVuZQLJb8bxJ53ks5sPb4bgaJpZM4N5QQ0 .