React (and JS ad web-development) newbie here.
I'm using react-select to build a filter box on the sidebar of a web map. The goal is that when I apply several filters (there's a checkbox and two multiple selection dropdown menus at the moment) the data on the map get updated accordingly.
The problem is that when I get the selected value through onChange, it seems I get the old options.
Example: a, b, c selected on the dropdown, I get a, b in the console.log.
So my filter function cannot use updated values.
If I use the DOM (through document.getElementsByName), I receive a NodeList which is off-by-one when I try to convert to an array (it loses the last selected option somehow...); If I use the event on handleChange, I don't get a representation of the event but just the values (this is problematic because I have several filters and each triggers the handleChange so I need to know which menu triggered the event).
I know I've not been crystal clear, but any hint would be appreciated since I'm really stuck. Thanks a lot.