It seems that you are trying to assign the wrong types, because you are using an optional Maybe variable to a SliceZoneLike<SliceLike<String>> that can return null. You have probably to convert
SliceZoneLike<SliceLike> to an optional.
Please let me know if you need any further help,
Thanks for the reply, I think I still need some help though.
What I don't get is why the slice from the document (the x.body1 in my code) doesn't just work "out of the box".
I.e. this is roughly my process:
The types for the Prismic documents are generated automatically from the graphQL API. This gives me the following types for the documents that are relevant here (body1 is the main thing here as that's the slices array field):
The slices field body1 is of the type Maybe<Array<MyContentPageBody1>> because that's what's automatically generated. How do I get it to the form SliceZoneLike<SliceLike<String>> | undefined? I feel like a slice array of a Prismic document (in our case body1) should be automatically typed like that, but I'm probably misunderstanding something
The slices body1 don't contain any field called slice_type but from reading the source code of @prismicio/react and from the second screenshot I sent above I can see that's required. When I was playing around in the Prismic graphQL API UI for my repo this field wasn't available anywhere in the body1 slices field. Where does that field come from?