Skip to content

typo on the source code for connectAdvanced? #739

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

Closed
hkjpotato opened this issue Jul 10, 2017 · 5 comments
Closed

typo on the source code for connectAdvanced? #739

hkjpotato opened this issue Jul 10, 2017 · 5 comments

Comments

@hkjpotato
Copy link

hkjpotato commented Jul 10, 2017

Hi, in the source of connectAdvanced line 255 it seems there is a typo in the comment

//Doing it this way vs having a permanent componentDidMount that does
// a boolean check every time avoids an extra method call most of the time, resulting
 // in some perf boost.

How to do a boolean check in the 'componentDidMount' for the succesive update since it will only be called once in the lifecycle? Could you explain how to use a permanent componentDidMount method that does the same thing like the current temporal 'componentDidUpdate' approach?

Thank you.

@jimbolla
Copy link
Contributor

That was probably supposed to be componentDidUpdate.

@timdorr
Copy link
Member

timdorr commented Jul 10, 2017

Yeah, I'll go change it.

@timdorr timdorr closed this as completed Jul 10, 2017
@hkjpotato
Copy link
Author

hkjpotato commented Jul 10, 2017

Thank you. It makes sense now. I guess the logic here is that only when an update triggered by its onStateChange needs to do the notifyNestedSubs. If we implement a permanent componentDidUpdate then if it is triggered by a parent's re-render it should have a boolean to stop it from doing the notification.

@hkjpotato

This comment has been minimized.

@xusanduo08

This comment has been minimized.

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

4 participants