Check out example codes for "How to initialize data in Preview provider in SwiftUI". It will help you in understanding the concepts better.

Code Example 1

struct StoryDetails_Previews: PreviewProvider {
    static var previews: some View {
        StoryDetails(
            story: Story(
                id: 1,
                author: 1,
                body: "Testing",
                edited_time: "September 2019",
                pub_date: "October 2018",
                comments: [Comment](),
                story_likes: [StoryLike]()
             )
        )

Learn ReactJs, React Native from akashmittal.com