Prismic slice machine with expo/react-native

I have seen a lot of documentation surrounding configuring slice-machine to work with nextjs. I am currently developing a mobile application suing expo in react-native and require prismic as my CMS.

My current implementation simply uses the prismic/client library to fetch content from pages of a certain type. I was wondering if it would be possible for me to configure slice-machine to work with expo and react-native as well. I didn't find any documentation online relating to this.

Any help or a solid answer would be appreciated, thanks in advance!

P.S. Apologies if question is too vague/dumb.

Hi Muhammad,

Welcome to the community :slight_smile:

Thanks so much for reaching out — and no need to apologize, your question is totally valid!

You’re right that most of the documentation for Slice Machine focuses on web frameworks like Next.js or Nuxt. Currently, Slice Machine is designed to work primarily with traditional web environments, where slices are rendered in server-side or static-site contexts. Unfortunately, it doesn’t officially support React Native or Expo at this time.

That said, your current approach using @prismicio/client to fetch and render content manually in your mobile app is the recommended way to work with Prismic in React Native. While you won’t be able to use Slice Machine’s local component development or previews, you can still structure your content in Prismic using custom types and retrieve it as JSON for use in your app components.

If we expand support for mobile environments in the future, we’ll make sure to update our documentation and share the news. In the meantime, if you run into any specific issues fetching or structuring your content, we’d be happy to help out.

Thanks.

1 Like