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

162
Views
no es asignable a un parámetro de tipo [Reaccionar]

Tengo un problema al reaccionar. Escribí el tipo de enumeración.

enum.ts

 export enum DivingType { FreeDiving = "FreeDiving", ScubaDiving = "ScubaDiving", }

y mi pantalla de inicio tiene ganchos graphql

casa.tsx

 import { DivingType } from "..." export const Home = () => { const [divingType, setDivingType] = useState<DivingType>(DivingType.FreeDiving) const [pageNumber, setPageNumber] = useState(1) useMatchingList(divingType, pageNumber) // --------------------[ Return ]-------------------- return ...

usarMatchingList.tsx

 interface IUseMatchingListProps { divingType: DivingType pageNumber: number } export const useMatchingList: React.FC<IUseMatchingListProps> = ({ divingType, , }) => {...}

y yo tengo

 Argument of type 'import("...").DivingType' is not assignable to parameter of type 'PropsWithChildren<IUseMatchingListProps>' useMatchingList(divingType, pageNumber) | ^

Cuál es el problema ? por favor, ayúdame !

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

El FC en React.FC significa "Componente funcional". Y un gancho no es un componente. Un gancho personalizado es solo una función que llama a otros ganchos. Entonces toma argumentos como lo haría cualquier función.

Eso significa que tus ganchos deberían parecerse más a esto:

 export const useMatchingList = (divingType: DivingType, pageNumber: number) => { // my hook implementation }

Ejemplo de seguridad de tipos de trabajo

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!