I have application and i need to keep search history, in my opinion Map is suitable here:
const [searchHistory, setSearchHistory] = useState(new Map());
to update it use setSearchHistory(new Map([[text, result.repos]])); but it replaces Map with new Map, could you please tell me how can i add value to Map initialized in state ?