Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

512
Vistas
Type is not assignable to type IntrinsicAttributes

I have create a function like this:

type MainProps = { sticky: boolean, refStickyElement: any };
export const MainBlog = ({ sticky, refStickyElement }: MainProps,mposts: TPost[]) => {
...

but when I want to use this function at another function I got error:

  const {results} = data
  let posts: Array<TPost> = results;
 <MainBlog refStickyElement={element} sticky={isSticky} posts={posts} />

error is for posts={posts}:

Type '{ refStickyElement: MutableRefObject<null>; sticky: boolean; posts: TPost[]; }' is not assignable to type 'IntrinsicAttributes & MainProps'.
  Property 'posts' does not exist on type 'IntrinsicAttributes & MainProps'.
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

If you want to pass posts as a prop, you have to add it to the MainProps type. React function components only have one param, which is an object (the props).
Therefore, you would have change your MainProps type to:

type MainProps = { sticky: boolean, refStickyElement: any, posts: TPost[] };

export const MainBlog = ({ sticky, refStickyElement, posts }: MainProps) => {
  //  ...
}
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda