Update Modules30Changes.md (#4211)

This commit is contained in:
Hristo Hristov
2017-05-17 13:09:38 +03:00
committed by GitHub
parent b67213120e
commit 781c46374b

View File

@@ -151,6 +151,12 @@ There are several type of Properties in modules 3.0:
* `CssProperty` property defined on `Style` type. These are properties that could be set in CSS. * `CssProperty` property defined on `Style` type. These are properties that could be set in CSS.
* `InheritedCssProperty `- property defined on `Style` type. These are inheritable CSS properties that could be set in CSS and propagates value on its children. These are properties like `FontSize`, `FontWeight`, `Color`, etc. * `InheritedCssProperty `- property defined on `Style` type. These are inheritable CSS properties that could be set in CSS and propagates value on its children. These are properties like `FontSize`, `FontWeight`, `Color`, etc.
### Events raised when property value change
One significant change is that properties before 3.0 were raising two events when a value is changed - `propertyChange` and propertyName + `Change` (like `textChange`). The second event was added at some point to make module compatible with Anglular.
With 3.0 we removed `propertyChange` event and left only the second event. This was done in order to improve performance of our property system. This also leads to cleaner code (no need to listen for every `propertyChange` and then check the name of the poperty that raised the event).
With 3.0 if you want to get notification when some property value change you have to specify the *`propertyName`Change* as eventName to `addEventListener` method (like `textField.addEventListener('textChange'`, handler...)).
### NativeView property ### NativeView property
There is a new property `nativeView` in `ViewBase` class. It is recommended to use `nativeView` instead of `ios` and `android` properties. The `ios` and `android` properties are left for compatibility, however all view-lifecycle methods and native property callbacks (explained below) should work with the `nativeView` property. There is a new property `nativeView` in `ViewBase` class. It is recommended to use `nativeView` instead of `ios` and `android` properties. The `ios` and `android` properties are left for compatibility, however all view-lifecycle methods and native property callbacks (explained below) should work with the `nativeView` property.