Closed
Description
openedon May 7, 2022
When I assign the c# Array or List to JS, when I use the forEach in JS, it will report error, I think we need a class corresponding to JS array to help us easily pass arrays to JS.
Now I set the array to JS like this
public object CreateNativeArray<T>(List<T> data) {
SetValue("__$_convert_array_data__", new JSIList<T>(data));
var obj = Evaluate("var array = [];__$_convert_array_data__.forEach(t=>{array.push(t);});array;");
return obj;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment