meanwhile I switched to using react-flexview since it looks more promising after some tests.
Now my project still renders but when I navigate to my component FlexUI:
package ui;
import react.ReactComponent;
import redux.react.IConnectedComponent;
import react.ReactMacro.jsx;
import router.RouteComponentProps;
import redux.Redux.Dispatch;
import model.DataList;
import react_flexview.FlexView;
import react_virtualized.*;
class FlexUI
extends ReactComponentOfProps<IProps>
implements IConnectedComponent
{
public function new(props:IProps)
{
super(props);
}
override public function render():ReactElement
{
trace('go');
// passing computed state as props and `dispatch` function
return jsx('
<FlexView>
<FlexView grow={1} >1</FlexView>
<FlexView grow={2} >2</FlexView>
</FlexView>
');
}
}
I get console errors:
VM3516 ui_FlexUI.js:33 go
VM3497 libs.js:2006 Uncaught (in promise) TypeError: Cannot read property ‘hx_proxy’ of undefined
at Object.React.createElement (VM3497 libs.js:2006)
at ui_FlexUI.render (VM3516 ui_FlexUI.js:34)
at VM3497 libs.js:15853
at measureLifeCyclePerf (VM3497 libs.js:15132)
at ReactCompositeComponentWrapper._renderValidatedComponentWithoutOwnerOrContext (VM3497 libs.js:15852)
at ReactCompositeComponentWrapper._renderValidatedComponent (VM3497 libs.js:15879)
at ReactCompositeComponentWrapper.performInitialMount (VM3497 libs.js:15419)
at ReactCompositeComponentWrapper.mountComponent (VM3497 libs.js:15315)
at Object.mountComponent (VM3497 libs.js:21689)
at ReactCompositeComponentWrapper.performInitialMount (VM3497 libs.js:15428)
Below my extern attempt for react-flexview:
package react_flexview;
import haxe.extern.EitherType;
import react.React.ReactChildren;
import react.ReactComponent;
/**
* ...
* @author axel@cunity.me
*/
typedef IProps =
{
?children:ReactChildren,
?basis: EitherType<String,Int>,
?className: String,
?style: Dynamic,
?width: EitherType<String,Int>,
?height: EitherType<String,Int>,
?column: EitherType <Bool,String>,
?grow: EitherType <Bool,String>,
?shrink: EitherType <Bool,String>,
?vAlignContent: String,
?hAlignContent: String,
?marginLeft: EitherType<String,Int>,
?marginRight: EitherType<String,Int>,
?marginTop: EitherType<String,Int>,
?marginBottom: EitherType<String,Int>,
?wrap: Bool
}
@:jsRequire("react-flexview", "FlexView")
@:native('FlexView')
@:keepSub
@:autoBuild(react.ReactMacro.buildComponent())
@:autoBuild(react.ReactTypeMacro.alterComponentSignatures())
#if (debug && react_render_warning)
@:autoBuild(react.ReactDebugMacro.buildComponent())
#end
extern
class FlexView extends ReactComponentOfProps<IProps>
{ }
the project template and build steps are as in the haxe-react-redux example
src/libs:
//
// npm dependencies library
//
(function(scope) {
'use-strict';
scope.__registry__ = Object.assign({}, scope.__registry__, {
// list npm modules required in Haxe
'react': require('react'),
'react-dom': require('react-dom'),
'react-router': require('react-router'),
'react-virtualized': require('react-virtualized'),
'redux': require('redux'),
'react-flexview': require('react-flexview')
});
if (process.env.NODE_ENV !== 'production') {
// enable hot-reload
require('haxe-modular');
}
})(typeof $hx_scope != "undefined" ? $hx_scope : $hx_scope = {});
npm run libs
npm run serve