Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

229
Views
How to link expo with Sanity.io

I am fairly new to sanity. I just want to know how to connect it to a react native project using expo.

I tried adding 'exp://192.168.1.23:19000' in sanity's Cors. But it didn't accept 'exp://'

is there a way to add an expo project in sanity Cors?

Home.js

import React from 'react';
import client from '../client';
import { urlFor } from '../client';

export const getData = async () => {
    const query = `*[_type == "upload"]`
    const uploads = await client.fetch(query);

    return{
      props: { uploads }
    }
}

export const Test = ({ upload: { image } }) => {
  return(
    <Image 
    source={urlFor(image)}
    style={{
      height: 250,
      width: 250
    }}
    />
  );
}




const Home = ({ uploads }) => {
  return (
    <SafeAreaView>
      <View style={{ flex:1, justifyContent: "center", alignContent: "center" }}>
          {uploads?.map(
            (upload) => <Test key={upload._id} upload={upload} />
          )}
      </View>
    </SafeAreaView>
  )
}

export default Home;

client.js

import sanityClient from "@sanity/client";
import imageUrlBuilder from "@sanity/image-url";

const client = sanityClient({
    projectId: "myProjectId",
    dataset: "production",
    apiVersion: "2022-03-10",
    useCdn: true,
    token: "myToken",
});

// All the fields that dont have the required value like 'myToken', I just removed them for security reasons

const builder = imageUrlBuilder(client);

export const urlFor = (source) => builder.image(source);
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!