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

101
Views
Cannot read properties of undefined (reading 'object') using formik

so this is my first time use formik and Yup and i got this error while using a function: TypeError Cannot read properties of undefined (reading 'object')

Code:

   import React from "react";
   import "./formikpostup.css";
   import { Formik } from "formik";
   import {Yup} from "yup";

  export default class FormikPostupload extends React.Component{
   uploadPost = Yup.object().shape({
   imageUrl: Yup.string().url().required('A url is required'),
   caption: Yup.string().max(200,'Caption has reached the maximum character limit')
   })

  render(){
    return(
      <div className="formik-upload-parent">
      <div>
      
      </div>
    </div>
   );
   } 
   }
almost 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You need to import Yup correctly as:

import * as Yup from 'yup';
almost 4 years ago · Santiago Trujillo Report
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!