Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6212

How to access nested data interface in React TypeScript

$
0
0

In React TypeScript, what is the appropriate way to access data in a nested interface like the one below?

export interface School {  prices: Array<{    state: {      response_header?: {        school_type_opportunities?: Array<{ benefit_type_opportunity?: string }>;        school_alternative_products?: Array<{          school_alternative_cost_share_incentive?: string;          school_alternative_description?: string;          school_alternative_id?: string;          school_attendance_required?: Array<{            school_attendance_location?: string;            school_attendance_blabla?: string;            school_attendance_blabla2?: string;          }>;        }>;

I want to get access to:

  • school_type_opportunities
  • school_alternative_description
  • school_attendance_location

Viewing all articles
Browse latest Browse all 6212

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>