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

277
Vistas
import variable in React native

i am storing values into three different variable.

const companyValue = useSelector((state) => state.changeCompanyReducer.company);
const selectionValueArray = Object.values(companyValue);
const companyCode = selectionValueArray[0];
const employeeId = selectionValueArray[1];

i am getting 3 values from selectionValueArray , companyCode , employeeId .

i want to place whole code in one file and import all these three variable name anywhere i want so that i can get 3 different values.

How can i achieve this?Thanks.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can do something like this

export const companyValue = your value
export const selectionValueArray = some value

Now you have to import like

import {companyValue, selectionValueArray} from './yourfile'

This type of import and export is called named export and import.
Learn more about it here

about 4 years ago · Juan Pablo Isaza Denunciar
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