eucaos
4 Sep 2018, 5:43 AM
Standard html elements (like <div />) are not rendered when using ext-react with the classic toolkit !
Steps to reproduce:
Install and run the example here https://github.com/eucaos/ext-react-6.6-bug
OR
1. Install ext-react classic toolkit boilerplate from here https://github.com/sencha/ext-react/tree/master/packages/ext-react-classic-boilerplate
2. In https://github.com/sencha/ext-react/blob/master/packages/ext-react-classic-boilerplate/src/index.js file change
<ExtReact>
<AppContainer>
<Component />
</AppContainer>
</ExtReact>
To
<ExtReact>
<AppContainer>
<div>asd</div>
</AppContainer>
</ExtReact>
3. Run the application with npm start
4. Exception is thrown
ExtRenderer.js:179 Uncaught TypeError: Cannot read property 'dom' of undefined
at finalizeInitialChildren (ExtRenderer.js:179)
at completeWork (react-reconciler.development.js:6146)
at completeUnitOfWork (react-reconciler.development.js:7751)
at performUnitOfWork (react-reconciler.development.js:7928)
at workLoop (react-reconciler.development.js:7940)
at renderRoot (react-reconciler.development.js:7980)
at performWorkOnRoot (react-reconciler.development.js:8598)
at performWork (react-reconciler.development.js:8520)
at performSyncWork (react-reconciler.development.js:8492)
at requestWork (react-reconciler.development.js:8392)
I traced the problem back to this to lines in Extrenderer.js
var cmp = Ext.create({ xtype: 'component', cls: 'x-react-element' });
ReactDOM.render(React.createElement(type, props, props.children), cmp.el.dom);
"el" is undefined on "cmp", which is not the case if you use the modern toolkit.
The Ext.create function provides the "el" field when using the modern toolkit.
Steps to reproduce:
Install and run the example here https://github.com/eucaos/ext-react-6.6-bug
OR
1. Install ext-react classic toolkit boilerplate from here https://github.com/sencha/ext-react/tree/master/packages/ext-react-classic-boilerplate
2. In https://github.com/sencha/ext-react/blob/master/packages/ext-react-classic-boilerplate/src/index.js file change
<ExtReact>
<AppContainer>
<Component />
</AppContainer>
</ExtReact>
To
<ExtReact>
<AppContainer>
<div>asd</div>
</AppContainer>
</ExtReact>
3. Run the application with npm start
4. Exception is thrown
ExtRenderer.js:179 Uncaught TypeError: Cannot read property 'dom' of undefined
at finalizeInitialChildren (ExtRenderer.js:179)
at completeWork (react-reconciler.development.js:6146)
at completeUnitOfWork (react-reconciler.development.js:7751)
at performUnitOfWork (react-reconciler.development.js:7928)
at workLoop (react-reconciler.development.js:7940)
at renderRoot (react-reconciler.development.js:7980)
at performWorkOnRoot (react-reconciler.development.js:8598)
at performWork (react-reconciler.development.js:8520)
at performSyncWork (react-reconciler.development.js:8492)
at requestWork (react-reconciler.development.js:8392)
I traced the problem back to this to lines in Extrenderer.js
var cmp = Ext.create({ xtype: 'component', cls: 'x-react-element' });
ReactDOM.render(React.createElement(type, props, props.children), cmp.el.dom);
"el" is undefined on "cmp", which is not the case if you use the modern toolkit.
The Ext.create function provides the "el" field when using the modern toolkit.