|
| 1 | +--- |
| 2 | +title: Update Guide | Ignite UI for React | Infragistics |
| 3 | +_description: Check out this article on updating how to update to a newer version of the Ignite UI for React library. |
| 4 | +_keywords: ignite ui for react, update, npm package, material components |
| 5 | +--- |
| 6 | + |
| 7 | +# Update Guide |
| 8 | +In the Ignite UI for React versioning the first number always matches the major version of React the code supports and the second is dedicated for major version releases. Breaking changes may be introduced between major releases. A comprehensive list of changes for each release of Ignite UI for React can be found in the product [CHANGELOG](./general-changelog-dv-react.md). |
| 9 | + |
| 10 | + |
| 11 | +## From 18.9.0 to 19.0.0 |
| 12 | +This release include a major rework of some of our React components internals leading to the following changes in **igniteui-react** and **igniteui-react-grids** packages: |
| 13 | + |
| 14 | +### General |
| 15 | +#### Breaking changes |
| 16 | + |
| 17 | +- Ignite UI for React components are now using React Function Components, therefore references obtained from ***useRef*** will now be a forward of the native element instead of a class component instance. Many of the use cases could remain unchanged but there are possible changes required such as not needing an extra property to access the DOM element itself. |
| 18 | +- Components no longer accept alternative string union on all properties types (e.g ***boolean | string*** or ***number | string***). Additionally, string union types are no longer case-insensitive. |
| 19 | +```tsx |
| 20 | +<IgrColumn dataType="String" sortable="true"></IgrColumn> |
| 21 | +``` |
| 22 | +Becomes: |
| 23 | +```tsx |
| 24 | +<IgrColumn dataType="string" sortable={true}></IgrColumn> |
| 25 | +``` |
| 26 | +- Component events are now **on** prefixed, i.e: |
| 27 | +```tsx |
| 28 | +<IgrGrid columnPin={handlePinning}></IgrGrid> |
| 29 | +``` |
| 30 | +Becomes |
| 31 | +```tsx |
| 32 | +<IgrGrid onColumnPin={handlePinning}></IgrGrid> |
| 33 | +``` |
| 34 | +- Component events emit a single standard **CustomEvent** argument instead of the **sender** as first argument. Therefore, custom properties like ***sender.nativeElement*** are no longer available, but native event properties all are. Also, types for event arguments are available as aliases for the specific custom event, so usage accessing ***detail*** will remain the same. With the new handler signature ***event.detail*** is the same and ***event.target*** is the DOM element equivalent to the sender: |
| 35 | +```tsx |
| 36 | + const handlePinning = (sender: IgrGridBaseDirective, event: IgrPinColumnCancellableEventArgs) => {}; |
| 37 | +``` |
| 38 | +Becomes: |
| 39 | +```tsx |
| 40 | + const handlePinning = (event: IgrPinColumnCancellableEventArgs) => {} |
| 41 | + // equivalent to |
| 42 | + const handlePinning = (event: CustomEvent<IgrPinColumnCancellableEventArgsDetail>) => {} |
| 43 | +``` |
| 44 | +- Components no longer have the non-functional ***name*** property by default. The ***name*** property only remains in **igniteui-react** components, mostly form inputs such as **IgrInput** and **IgrCombo**, where it has native functionality. |
| 45 | +- Ignite UI for React components no longer require a ***key*** property, unless it is necessary according to React`s [documentation](https://react.dev/learn/rendering-lists#keeping-list-items-in-order-with-key) |
| 46 | +- The [IgrDataGrid](./grids/data-grid/overview.md) is no longer part of **igniteui-react-grids** package. It has been moved to **igniteui-react-data-grids**, making **igniteui-react-grids** more lightweight. |
| 47 | +- There were several types that were exposed as classes in version **18.9.0** which is no longer the case. Those are now exported as types and can be used like this: |
| 48 | +```tsx |
| 49 | +const pivotConfiguration = new IgrPivotConfiguration(); |
| 50 | +``` |
| 51 | +Becomes: |
| 52 | +```tsx |
| 53 | +const pivotConfiguration: IgrPivotConfiguration = { |
| 54 | + rows: [], |
| 55 | + columns: [], |
| 56 | + values: [] |
| 57 | +} |
| 58 | +``` |
| 59 | +- **IgrButton** |
| 60 | + - **Breaking Changes** |
| 61 | + - ***clicked*** event is removed. Use native ***onClick*** instead. |
| 62 | +- **IgrInput** |
| 63 | + - **Breaking Changes** |
| 64 | + - ***inputOccurred*** event is renamed to ***onInput***. |
0 commit comments