SimformSolutionsPvtLtd / react-native-story-view

A React Native component to show image and video stories ✨ 🎖
MIT License
231 stars 33 forks source link

Types mismatching #59

Closed GritAr closed 1 year ago

GritAr commented 1 year ago

export type StoryType = { id: number; url?: string; thumbnail?: string; type?: string | 'image' | 'video' | 'text'; duration?: number; isReadMore?: boolean; isSeen?: boolean; isPaused?: boolean; created?: string; storyId?: number; title?: string; };

export type StoriesType = { username?: string; profile?: string; title?: string; id: number; stories: StoryType[]; };

Doc: [{ id: string; username: string; title: string; profile: string; stories:Array[ { id: string; url: string; type: 'image' | 'video'; duration: number isReadMore: boolean storyId: number, isSeen?: boolean, } ] }]

GritAr commented 1 year ago

Perhaps it's better to make the ID a string | number. It's hard to imagine a scenario where something like a UUID hasn't been used as an ID.