title: React Cannot update a component from inside the function body of a different component
body: <p>I made a form with Formik and react-reaflet, when the user clicks on the button, a map appears with a predefined longitude and latitude and he can navigate on the map and automatically change its location by dragging the cursor.</p>
  <p>The functionality works as expected but when I click on the cursor to change the location, React shows me in the console this error <strong>Warning: Cannot update a component (<code>Main</code>) while rendering a different component (<code>Formik</code>).</strong>. I tried to solve it but it still doesn't work. I created this <a href="https://codesandbox.io/s/lfv2u" rel="nofollow noreferrer">sandbox</a> so you can see how the error appears on the console</p>