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

Fix component generator called multiple times #6239

Merged
merged 4 commits into from
May 25, 2020
Merged

Conversation

guyca
Copy link
Collaborator

@guyca guyca commented May 21, 2020

Fix registered component generator function called multiple times. Apparently this hasn't resulted in actual bugs, but it's unpredictable behaviour which can easily lead to bugs and issues.

This commit caches registered components so they are created only once.

Fixes #6232

Fix registered component generator function called multiple times. Apparently this hasn't resulted in actual bugs, but it's unpredictable behaviour which can easily lead to bugs and issues.

This commit caches registered components so they are created only once.
@guyca guyca changed the title Initial commit Fix component generator called multiple times May 21, 2020
@guyca guyca merged commit 8ec7bcd into master May 25, 2020
@guyca guyca deleted the componentProviderFixes branch May 25, 2020 14:59
guyca pushed a commit that referenced this pull request Aug 23, 2020
Currently when re-registering a component (calling `Navigation.registerComponent` with the same `componentName` more than once), the actual registered component does not get used if the component before that was already used. This is because on creation of the wrapped component it is cached. Therefor, we have to clear the wrapped component from the cache when registering a new component under the same name.

This also keeps the intended fix of #6239 (not calling the generator more than once), but restores the capability to replace a component.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The callback passed to Navigation.registerComponent is called four times.
2 participants