#I can't figure out how to get event properties in onChange in my Mantine Select

5 messages · Page 1 of 1 (latest)

plucky widget
#

Sandbox: https://codesandbox.io/s/green-sun-k1v5gj?file=/src/App.tsx
I'm migrating to Mantine for the first time (love the look) but I am not sure how to make my <Select> use the event properties. The docs mention event listeners, but I don't see how I can pass in the value as a prop.
My old vanilla component looked like this
<select onChange={(e) => { if (e) { pickGameBoard(e.target.value) } }}> {selectionOptionsOLD} </select>
When I ues the exact same onClick with the mantine Select...
<Select label="Choose a gameboard" placeholder="Pick one" data={boardSelectOptions} onChange={(e) => { if (e) { pickGameBoard(e.target.value) } }} />
I get a TypeScript error "Property 'target' does not exist on type 'string'."
Anybody know what I'm doing wrong?

Forgive me if this has been asked before. I couldn't find it if it was.

green-sun-k1v5gj by vpbasile using @emotion/react, @mantine/carousel, @mantine/core, @mantine/dates, @mantine/form, @mantine/hooks, @mantine/modals, @mantine/notifications, @mantine/prism

raven flicker
sharp vessel
#

So, if I have multiple mixed inputs with some inputs called with events and some just values, what is the best way to get values from all the inputs in one function?

sharp vessel
#

Hi, is using different states for all nonconventional inputs like select, multi-select and radio the best option? Thanks!