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

118
Views
Problem returning a value with typescript

I'm trying to return a value with typescript but I always end up getting the following error:

Unsafe return of an any typed value.

This error is generated through a function in the @update of a select.

          <q-select
            outlined
            class="q-mb-lg"
            :options="rolesOptions"
            option-value="value"
            option-label="label"                
            :label="$t('Users.form.role')"
            v-model="fieldStates.role"
            @update:model-value="val => teste(val)" 
          />

This here would be my return, which I expect to receive the value of an option.

 const teste = ({value} : {value: any}) => {
   console.log('test: ', value)
   return value
 }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can use generics to avoid the use of any.

const teste = <T>({value} : {value: T}) => {
   console.log('test: ', value)
   return 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!