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

100
Views
Expected 1 arguments, but got 0. TS2554 - Optional Object Properties but not Object?

I believe all the object properties are optional, so I do not fully understand the errors. Because I've made the properties optional, but not the object itself?

Error

Expected 1 arguments, but got 0.  TS2554

    71 |   // Get the claims on the initial page load
    72 |   useEffect(() => {
  > 73 |     fetchClaimDetails();
       |     ^
    74 |   }, []);
    75 | 
    76 |   return (

Component

 interface fetchClaimDetailsQueryParams {
  status?: string | null;
  clientClaimId?: string | null;
}

const fetchClaimDetails = async ({
  clientClaimId = null,
  status = null
}: fetchClaimDetailsQueryParams) => {

......

useEffect(() => {
  fetchClaimDetails();
}, []);
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Even if every property of the object are optional, the object itself is required. If you truly want it to be optional, provide a default value of {} as the value for the object.

const fetchClaimDetails = async ({
  clientClaimId = null,
  status = null
}: fetchClaimDetailsQueryParams = {}) => { ... };
about 4 years ago · Juan Pablo Isaza Report

0

Yes. Making the object optional will not fix the error, as the object is being destructured in the parameter list. You need something like this:

const fetchClaimDetails = async (paramsObj: fetchClaimDetailsQueryParams = {
  clientClaimId: null,
  status: null
}) => {
  const {
    clientClaimId,
    status
  } = paramsObject;
}

This should make the parameter optional while providing a valid default value.

about 4 years ago · Juan Pablo Isaza 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!