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

React-wrapped components inside inside ng-template don't re-render on changes #4

Merged
merged 5 commits into from
Aug 13, 2018

Conversation

bengry
Copy link
Contributor

@bengry bengry commented Aug 13, 2018

Solves #5.

Angular does detect the changes (as can be seen when inspecting the instance, as well as <counter> element in the DOM), but the ReactRenderer does not re-render the inner React component DefaultButton (note that the ngOnChanges of FabDefaultButtonComponent is triggered though).

The solution proposed in this PR is to manually add all ReactWrapperComponents as react root nodes to the ReactRenderer, which means that they will be re-rendered as needed.

This is a breaking change, since ReactWrapperComponent now requires a Renderer2 to be injected, meaning any derived components need to have it injected and pass it up. This covers most of the changes in this PR.

@bengry bengry changed the title Bugfix/inner react render props not render React-wrapped components inside inside ng-template don't re-render on changes Aug 13, 2018
benfeely
benfeely previously approved these changes Aug 13, 2018
Ben Grynhaus added 2 commits August 13, 2018 20:07
# Conflicts:
#	libs/fabric/package.json
#	libs/fabric/src/lib/components/command-bar/command-bar.component.ts
@bengry bengry merged commit 299e4b4 into master Aug 13, 2018
@bengry bengry deleted the bugfix/inner-react-render-props-not-render branch August 13, 2018 18:23
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

Successfully merging this pull request may close these issues.

2 participants