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

114
Views
how can I handle this type with only one parameter?

I have a model of these:

image: string;
redirect_option: 'PROFILE' | 'PRODUCT';
redirect: Product | User;

Now I render the list and want add a function:

const handleNavigateToRedirectedOption = ({ redirected_option, params }: { redirected_option: 'PROFILE' | 'PRODUCT'; redirect: Product | User;}) => {
    redirected_option === 'PROFILE' &&  navigation.navigate('UserProfile', params);
  };

const renderItem = ({ item }) => (
 <Pressable onPress={}>
   <Text>List</Text>
 </Pressable>
);

Now I get this error:

Argument of type 'IProduct | CurrentUser' is not assignable to parameter of type 'CurrentUser'.
  Type 'IProduct' is missing the following properties from type 'CurrentUser': user_id, profile_image, 

I know the problem but IDK how can I solve it. this comes at navigation...params

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

0

If you're just looking for a syntax fix:

navigation.navigate('UserProfile', params as CurrentUser);

But yeah, the real problem might has something to do with the way you're structuring and typing your codes.

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!