Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

63
Views
formik prevent default values when we go back to page

I'm using formik with checkbox fields, on select it gives id's and the next page is render, but when I get back to the page the checked fields go back to their default values i.e empty. How can I prevent it?

<Formik
                initialValues={{
                    pocList: "",
                }}
                onSubmit={onSubmit}
            >
                {({ handleSubmit, setFieldValue }) => {
                    formRef.current = { handleSubmit, setFieldValue };
                    return (
                        <Form style={{ width: "100%", marginTop: 10, marginBottom: 50 }}>
                            <FormItem>
                                {filteredPocList?.map(item => {
                                    return (
                                        <Field
                                            key={item.id}
                                            as={PocCard}
                                            type="checkbox"
                                            name="pocList"
                                            value={item.id}
                                            username={item.name}
                                            email={item.email}
                                        />
                                    );
                                })}
                            </FormItem>
                        </Form>
                    );
                }}
            </Formik>
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!