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

280
Views
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 answers
Answer question

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 Report
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!