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

208
Views
Initialize empty array of objects in react native

I want to create an empty array object in react native that I want to populate with data from a sqlite table. I've searched on google but I only get responses like this.state={} or this.state = { newArr: [] }, but I want to create an empty array of objects similar to const [{ID:'', Name:'', Email:''}].

any idea how I can achieve this?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Ideally, newArr=[] works. However if you want to make it something like that [{ID:'', Name:'', Email:''}]. It is also possible. Let me share some example.

const initialArr = [{ID:'', Name:'', Email:''}];
class YOURCOMPONENT extends React.Component{
constructor(props){
super(props);
this.state = {
newArr:initialArr,
}
}
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!