title: How to define setFieldValue in React
body: <p>I'm using Formik for validating the fields before creating an entity. There is a Select which opens a dropdown and the user must choose one option from there.</p>
  <p>I get an error saying that setFieldValue is not defined but where I've researched before I didn't find any definition of this method, it is just used like that so I don't know why is this happening.</p>
  <p>This is my code:</p>
  <pre><code>import React from 'react';
  import { Formik, Form, Field } from 'formik';
  import { Button, Label, Grid } from 'semantic-ui-react';
  import * as Yup from 'yup';
  
  class CreateCompanyForm extends React.PureComponent {
    constructor(props) {
      super(props);
  
      this.state = {
        industry: '',
      };
    }
  
    onChange = (e, { name, value }) =&gt; {
      this.setState({ [name]: value });
    };
  
    handleSubmit = values =&gt; {
      // ...
    };
  
    render() {
      const nameOptions = [
        { text: 'Services', value: 'Services' },
        { text: 'Retail', value: 'Retail' },
      ];
  
      const initialValues = {
        industry: '',
      };
      const requiredErrorMessage = 'This field is required';
      const validationSchema = Yup.object({
        industry: Yup.string().required(requiredErrorMessage),
      });
      return (
        &lt;div&gt;
          &lt;div&gt;
            &lt;Button type=&quot;submit&quot; form=&quot;amazing&quot;&gt;
              Create company
            &lt;/Button&gt;
          &lt;/div&gt;
  
          &lt;Formik
            htmlFor=&quot;amazing&quot;
            initialValues={initialValues}
            validationSchema={validationSchema}
            onSubmit={values =&gt; this.handleSubmit(values)}&gt;
            {({ errors, touched }) =&gt; (
              &lt;Form id=&quot;amazing&quot;&gt;
                &lt;Grid&gt;
                  &lt;Grid.Column&gt;
                    &lt;Label&gt;Industry&lt;/Label&gt;
                    &lt;Field
                      name=&quot;industry&quot;
                      as={Select}
                      options={nameOptions}
                      placeholder=&quot;select an industry&quot;
                      onChange={e =&gt; setFieldValue('industry', e.target.value)}  // here it is
                    /&gt;
  
                    &lt;div&gt;
                      {touched.industry &amp;&amp; errors.industry
                        ? errors.industry
                        : null}
                    &lt;/div&gt;
                  &lt;/Grid.Column&gt;
                &lt;/Grid&gt;
              &lt;/Form&gt;
            )}
          &lt;/Formik&gt;
        &lt;/div&gt;
      );
    }
  }
  </code></pre>
  <p>The error says: <code>'setFieldValue' is not defined  no-undef</code> - it is from ESLint. How can be this solved?</p>