Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

151
Vistas
Where/How to do heavy processing in React Native

I am building a React Native/Expo App and I am using a lexicon module (https://github.com/peterolson/chinese-lexicon) which fetches some big files and does some heavy transformations, so it takes about 10-15 seconds to load. While loading the module, the whole app freezes.

I know that there is no multithreading in Javascript - but there has to be a way to do some heavier processing without blocking the UI, right? Where/how do I load this module without making my app freeze?

I tried to edit the module and make it return a Promise which resolves as soon as the Lexicon is loaded:

function load() {
    return new Promise((Resolve, reject) => {
        //All the code from the module
        //Calling Resolve with the loaded lexicon
    }
}
module.exports = { load }

Now I am loading the lexicon like this: require('chinese-lexicon').load().then((lexicon) => { ... });, however it is still blocking the main thread - which makes sense, as the Promise executor function itself is still running synchronously.

I also tried some tricks like using setTimeout(() => { ... }, 0) in the Promise executor function, but it's still blocking.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda