title: How to get value from react-select in a functional component React
body: <p>I am making use of react-select for the first time in a form. I am having issues getting the value from the select input and send it via Axios to backend.</p>
  <pre><code>
  const options=[
    { value: 'Telecomms', label: 'Telecomms' },
    { value: 'Construction', label: 'Construction' },
    { value: 'Manufacturing', label: 'Manufacturing' },
  ]
  function Register(props) {
    
    const [newUser,getUser]=useState({
        name: &quot;&quot;,
        businessSector:&quot;&quot;,
       
    })
  
    const dispatch = useDispatch()
  
  // onChange handler
    const changeHandle=e=&gt;{
    
      getUser({
        ...newUser,
        [e.target.name]:e.target.value
  
      })
    }
  
    const SubmitHandle=e=&gt;{
  
      e.preventDefault()
      console.log(newUser)
     
      if (newUser) {
          dispatch(registerUser(newUser))
         
      }
    
    }
  
  
   return (
      &lt;FormDialog
        loading={isLoading}
        onClose={onClose}
        open
        headline=&quot;Registration&quot;
        onFormSubmit={SubmitHandle }
        hideBackdrop
        hasCloseIcon
        content={
          &lt;Fragment&gt;
            &lt;Grid Container spacing={20}&gt;
            &lt;TextField
              variant=&quot;outlined&quot;
              margin=&quot;normal&quot;
              name=&quot;name&quot;
              value={newUser.name}
              onChange={changeHandle}
              required
              fullWidth
             
              label=&quot;Full name&quot;
              autoFocus
              autoComplete=&quot;off&quot;
              type=&quot;text&quot;
              InputProps={{
                className: classes.input
              }}
              FormHelperTextProps={{ error: true }}
            /&gt;
            
             &lt;InputLabel id=&quot;demo-simple-select-label&quot;&gt;Business Sector&lt;/InputLabel&gt;
           &lt;Select
           value={newUser.businessSector} 
           onInputChange={changeHandle}
            options={options}
            name=&quot;businessSector&quot;
            /&gt;
  </code></pre>
  <p>Any time i try to select an option is gives the following error</p>
  <pre><code>Type error: cannot read property 'name' of undefined
  </code></pre>
  <p>I am wondering where am actually getting it wrong. If I try to check the state from the dev tools, its not registering on state.</p>