Open
Description
In JS we can do:
containerForValues.replaceChildren(...values.map((value) => {
const element = document.createElement('div');
element.innerHTML = value;
return element;
}));
In Dart we I tried using:
containerForValues.replaceChildren(
values
.map(
(value) => HTMLDivElement()
..setHTMLUnsafe(value),
)
.toList()
.toJS,
);
But this doesn't work, because the first argument can't be a list. So the list is converted to a String. Do my containerForValues
ends up showing:
[object HTMLDivElement],[object HTMLDivElement],[object HTMLDivElement]
:D