Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Router Error when using lifecycle onupdate #215

Closed
ahallock opened this issue May 21, 2017 · 1 comment
Closed

Router Error when using lifecycle onupdate #215

ahallock opened this issue May 21, 2017 · 1 comment
Labels
bug Something isn't working

Comments

@ahallock
Copy link

ahallock commented May 21, 2017

When moving between routes, I receive Uncaught TypeError: value is not a function if the other component doesn't have the onupdate lifecycle hook:

app({
  state: {},
  view: {
    '/dashboard': (state, actions) => h('div', {onupdate: e => console.log('dashboard updated')}, [
      h('h1', null, 'Dashboard'),
      h('a', {onclick: () => actions.router.go('/billing')}, 'Go to Billing')
    ]),
    '/billing': (state, actions) => h('div', null, [
      h('h1', null, 'Billing'),
      h('a', {onclick: () => actions.router.go('/dashboard')}, 'Go to Dashboard')
    ]),
  },
  actions: {},
  root: el,
  plugins: [Router]
})

To reproduce: Load /dashboard and click link "Go to Billing"

Using 0.9.1

@jorgebucaran jorgebucaran added the bug Something isn't working label May 21, 2017
@jorgebucaran
Copy link
Owner

@ahallock Reproduced. I'll patch this soon and publish a new release. Thanks for letting us know! 👍

jorgebucaran pushed a commit to jorgebucaran/superfine that referenced this issue Jun 4, 2017
jorgebucaran pushed a commit to jorgebucaran/superfine that referenced this issue Jan 6, 2018
jorgebucaran added a commit to jorgebucaran/superfine that referenced this issue Jan 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants