From 781c46374b9e6e5371c600135ce8ad805cf1970d Mon Sep 17 00:00:00 2001 From: Hristo Hristov Date: Wed, 17 May 2017 13:09:38 +0300 Subject: [PATCH] Update Modules30Changes.md (#4211) --- Modules30Changes.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Modules30Changes.md b/Modules30Changes.md index 37ba7929e..a8ecf6d1f 100644 --- a/Modules30Changes.md +++ b/Modules30Changes.md @@ -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. * `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 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.