all parts of web app development • Angular 2 is a toolset for building the framework most suited to your application development • React is a JavaScript library for building user interfaces
tag • configs are defined as standard component properties • items are defined as child components • layouts could be defined as component property ‘layout’ • event listeners could be bounded • Ext JS component instances could be accessed via special references
template, styles! Component’s properties and event handlers!
Ext JS Component’s template • x- is a prefix for all components • xtype is used as a component tag: x-panel, x-grid • all components have config property • all components have fitToParent property Angular 2
Ext JS Component’s template • all components have an Angular 2 property for each Ext JS config parameter: columns, store • all components have an Angular 2 event for each Ext JS event: select, itemclick Angular 2
Ext JS Layouts • all components have a layout property to specify layout: vbox, hbox, fit • containment is used to specify Ext JS items collection Angular 2
Ext JS Component References • all components have ready event • event.x is an instance of Ext JS grid Angular 2
JSX! set configs using tag props! import and install @extjs/reactor! import “reactified” Ext JS components! by xtype! React
Using Ext JS Components in React • Import a reactified version of any Ext JS component from the modern or classic toolkit. • Use capitalized, camel-case xtype React import { Grid, Panel } from '@extjs/reactor/modern'; ! ! import { reactify } from '@extjs/reactor'; ! const [ Grid, Panel ] = reactify('grid', 'panel'); ! ! Babel
“Reactified” Ext JS Components • set configs using props • all props starting with on are automatically converted to Ext JS event listeners • listeners prop could be used to specify event listeners, just like in traditional Ext JS React
Ext JS Layouts • all subclasses of Ext.Container have a layout property to specify layout: vbox, hbox, fit, etc… • containment is used to specify Ext JS items collection React
Ext JS Component References • Ext JS components can be accessed by adding a ref prop • this.refs.grid is an instance of Ext JS grid React
Updates • when a prop changes, @extjs/reactor automatically calls the corresponding setter method to update the component’s configs. React