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

218
Views
Posible rechazo de promesa no controlada (id: 25) con Sanity.io y React Native

Recibo una advertencia cuando uso el CMS de cordura para recuperar datos del back-end.

Aquí está mi código:

cliente.js

 import sanityClient from "@sanity/client"; import imageUrlBuilder from "@sanity/image-url"; const client = sanityClient({ projectId: "productKeyHidden", dataset: "production", apiVersion: "2022-03-10", useCdn: true, token:process.env.TOKEN, }); const builder = imageUrlBuilder(client); export const urlFor = (source) => { return builder.image(source); }

Inicio.js

 import { View, Image } from 'react-native'; import React, { useEffect, useState } from 'react'; import client from '../client'; import { urlFor } from '../client'; import styles from '../styles'; export default function Home(){ const [uploads, setUploads] = useState([]); const getImage = async () => { const query = `*[_type == 'upload']` const uploads = await client.fetch(query); setUploads(uploads); } useEffect(() => { getImage(); }, []) return ( <View> {uploads.map( upload => <Image source={urlFor(upload.image)} />} </View> ) }

No está recuperando los datos pero a veces me da el error destroy is not a function

¿Como arreglarlo?

EDITAR: olvidé poner la función urlFor() al publicar esto. pero de todos modos el error sigue siendo

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!