Guia de atualização
No Ignite UI for React controle de versão, o primeiro número sempre corresponde à versão principal do React o código dá suporte e o segundo é dedicado para versões principais. Alterações significativas podem ser introduzidas entre as versões principais. Uma lista abrangente de alterações para cada versão do Ignite UI for React pode ser encontrada no CHANGELOG do produto.
Da versão 18.9.0 para a 19.0.0
Esta versão inclui um grande retrabalho de alguns de nossos componentes internos React, levando às seguintes alterações nos pacotes igniteui-react e igniteui-react-grids:
Geral
Breaking changes
- 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.
- 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.
<IgrColumn dataType="String" sortable="true"></IgrColumn>
Becomes:
<IgrColumn dataType="string" sortable={true}></IgrColumn>
- Os eventos de componente agora são prefixados, ou seja:
<IgrGrid columnPin={handlePinning}></IgrGrid>
Becomes
<IgrGrid onColumnPin={handlePinning}></IgrGrid>
- Component events emit a single standard CustomEvent argument instead of the
senderas 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 accessingdetailwill remain the same. With the new handler signatureevent.detailis the same andevent.targetis the DOM element equivalent to the sender:
const handlePinning = (sender: IgrGridBaseDirective, event: IgrPinColumnCancellableEventArgs) => {};
Becomes:
const handlePinning = (event: IgrPinColumnCancellableEventArgs) => {}
// equivalent to
const handlePinning = (event: CustomEvent<IgrPinColumnCancellableEventArgsDetail>) => {}
- Components no longer have the non-functional
nameproperty by default. Thenameproperty only remains in igniteui-react components, mostly form inputs such asIgrInputandIgrCombo, where it has native functionality. - Ignite UI for React components no longer require a
keyproperty, unless it is necessary according to React`s documentation - O IgrDataGrid não faz mais parte do pacote igniteui-react-grids. Ele foi movido para igniteui-react-data-grids, tornando igniteui-react-grids mais leves.
- Havia vários tipos que foram expostos como classes na versão 18.9.0, o que não é mais o caso. Eles agora são exportados como tipos e podem ser usados assim:
const pivotConfiguration = new IgrPivotConfiguration();
Becomes:
const pivotConfiguration: IgrPivotConfiguration = {
rows: [],
columns: [],
values: []
}