Skip to content

Commit 91a380a

Browse files
author
Ben Grynhaus
committed
[core] Fix style logic in base wrapper component
1 parent 5a4acb6 commit 91a380a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

libs/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "../../node_modules/ng-packagr/package.schema.json",
33
"name": "@angular-react/core",
4-
"version": "0.2.0",
4+
"version": "0.2.1",
55
"ngPackage": {
66
"lib": {
77
"languageLevel": [

libs/core/src/components/wrapper-component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ export abstract class ReactWrapperComponent<TProps extends {}> implements AfterV
7474

7575
ngOnChanges(changes: SimpleChanges) {
7676
this._passAttributesAsProps();
77+
78+
this.detectChanges();
7779
}
7880

7981
protected detectChanges() {
@@ -183,7 +185,7 @@ export abstract class ReactWrapperComponent<TProps extends {}> implements AfterV
183185
if (name === 'style') {
184186
const style = toStyle(value);
185187
// Only allowing style if it's something that changes the display - setting anything else should be done on the child component directly (via the `styles` attribute in fabric for example)
186-
if (Object.entries(style).filter(([key, value]) => value || key !== 'display').length > 0) {
188+
if (Object.entries(style).filter(([key, value]) => value && key !== 'display').length > 0) {
187189
return [true, 'rStyle'];
188190
}
189191
}

0 commit comments

Comments
 (0)