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

Question: should onUpdate call when render returns the same thing? #387

Open
rstacruz opened this issue Jan 22, 2016 · 2 comments
Open

Question: should onUpdate call when render returns the same thing? #387

rstacruz opened this issue Jan 22, 2016 · 2 comments

Comments

@rstacruz
Copy link
Collaborator

should onUpdate be called when render returns the same thing (eg, when it was memoized)?

For instance:

var result = <div>hello</div>

module.exports = {
  render: () => result,
  onUpdate: () => { console.log('onupdate was called') }
}
@anthonyshort
Copy link
Owner

hrm, probably not. That does seem odd.

@rstacruz
Copy link
Collaborator Author

nah, i havent tested it, but i'm just wondering what the "spec" says. what if it's not memoized, but returns the same thing (that doesn't have sub-components)?

module.exports = {
  render: () => <div>hello!</div>,
  onUpdate: () => { console.log('onupdate was called') }
}

// should onUpdate be called twice if this was rendered twice?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants