You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I cannot use the lodash build macro in one of my page component file. Here is the macro debug output:
/usr/local/lib/haxe/std/neko/_std/Type.hx:220: characters 17-24 : Invalid field access : index
/usr/local/lib/haxe/std/haxe/macro/Printer.hx:114: characters 39-41 : Called from
/usr/local/lib/haxe/std/neko/_std/Array.hx:275: characters 12-18 : Called from
/usr/local/lib/haxe/std/haxe/macro/Printer.hx:118: characters 20-38 : Called from
<builtin>:1: character 0 : Called from
/usr/local/lib/haxe/std/haxe/macro/Printer.hx:318: characters 82-86 : Called from
/usr/local/lib/haxe/std/haxe/macro/Printer.hx:144: characters 44-75 : Called from
/Users/thomasfetiveau/wksp_myproj/myproj-apps-rn59/.haxelib/haxe-lodash/git/./lib/lodash/Lodash.hx:177: characters 11-44 : Called from
src/myproj/view/page/MenuPage.hx:314: characters 1-7 : Called from
Aborted
And here is the code of the page:
typedef MenuPageViewState = {
data:Array<Int>,
}
typedef MenuPageViewProps = {
> react.native.navigation.NavProps,
intl:IntlShape,
}
@:build(lib.lodash.Lodash.build())
class MenuPageView extends ReactComponentOf<MenuPageViewProps,MenuPageViewState> {
static var styles = MenuPageStyles.value;
function new(p){
super(p);
this.state = {data:[for(i in -10...10) i]};
}
private var _list:FlatList<Int>;
function onListRef(r:FlatList<Int>){
if(r==null) return;
_list=r;
}
function keyExtractor(item:Int,_):String{
return Std.string(item);
}
function scrollToOffset(v:Float){
trace('scrollToOffset',v);
if(_list==null) return;
_list.scrollToOffset({animated:true,offset:v});
}
@:throttle(1000, {leading:true,trailing:false})
function onEndReached(_){
trace('onEndReached');
setState({data:state.data.concat([for(i in state.data.length-10...state.data.length) i])});
}
function renderItem(v:{item:Int}){
return null;
}
override function render() {
return jsx('
<>
<View style=${styles.page}>
<View style=${styles.titleView}>
<Text style=${styles.title}>
<FormattedMessage id="account_page_menus" mode=${Uppercase} />
</Text>
</View>
<FlatList
ref=${onListRef}
keyExtractor=${keyExtractor}
style=${styles.scroller}
contentContainerStyle=${styles.scrollerContent}
renderItem=${renderItem}
onEndReached=${onEndReached}
data=${state.data}
/>
</View>
</>
');
}
}
Any idea?
The text was updated successfully, but these errors were encountered:
This one is a little bit complicated.
The current behaviour makes the parameters received by the throttled method sent to the "original" methods. Most of the time, we want the parameters to be passed.
Could we consider that an "unspecified" parameter, named after "_", could be ommited ?
I did an attempt to fix that scenario in the commit 5eb390b
Can you have a look in your test case ? (I did something very bad, a blind commit without testing... since I don't have the environment setup at the moment)
I cannot use the lodash build macro in one of my page component file. Here is the macro debug output:
And here is the code of the page:
Any idea?
The text was updated successfully, but these errors were encountered: