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

514
Views
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 answers
Answer question

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 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!