title: is there anyway to get redux state updated data with in same onSubmit method after submitting formik?
body: <p>Currently I am using <strong>React</strong>, <strong>Redux Toolkit</strong> and  <strong>Formik</strong>  in my current project and the situation is that while i am submitting form data (using useFormik() hook) with help onSubmit method; with in onSubmit method i am calling Redux action (using useDispatch() hook) then access the state data directly using useSlector hook but i am getting always previous value. The sample codes are given below :</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code> const formik = useFormik({
      initialValues,
      onSubmit : (values) =&gt; {
        alert(JSON.stringify(values));
        dispatch(loginSumbmit(values));    
        console.log(authState); // get previous data
      },
      validationSchema,
    });</code></pre>
  </div>
  </div>
  </p>