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

233
Views
Type 'string' is not assignable to type 'ReviewsKeyType' TS ERROR

I got this TS Error, can anyone explain me what I am doing wrong ?

Type '{ key: string; number: number | undefined; }[]' is not assignable to type 'IReviewsRoute[]'.
  Type '{ key: string; number: number | undefined; }' is not assignable to type 'IReviewsRoute'.
    Types of property 'key' are incompatible.
      Type 'string' is not assignable to type 'ReviewsKeyType'.ts(2322)

Model:

export type ReviewsKeyType = 'ONE' | 'TWO' | 'THREE' | 'FOUR' | 'FIVE';

export interface IReviewsRoute {
  key: ReviewsKeyType;
  number: number | undefined;
}

Data

    const ROUTES: IReviewsRoute[] = [
      {
        key: 'ONE',
        number: 1
      },
      {
        key: 'TWO',
        number: 2
      },
      {
        key: 'THREE',
        number: 3
      },
      {
        key: 'FOUR',
        number: 4
      },
      {
        key: 'FIVE',
        number: 5
      }
    ];

Why he say string is not assignagble to type reviewskeytpe ? I didnt put a string anywhere

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