I'm currently exploring the example, but I have doubts about whether I can implement it in this manner.
import _ from "lodash";
...
let [widget, setWidgetList] = useState([]);
onRemoveItem(i) {
console.log("removing", i);
setWidgetList(_.reject(widget, { i: i }));
}
The code snippet below is extracted from the provided example:
onRemoveItem(i) {
console.log("removing", i);
this.setState({ items: _.reject(this.state.items, { i: i }) });
}