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

414
Views
Cómo dividir valores de elementos de matriz en Firebase Firestore Array en React.js

Tengo una matriz en mi colección de firestore llamada características y contiene un conjunto de características. Ahora quiero extraer los valores de la matriz, hacer un bucle y mostrarlos en una lista.

Pero cuando lo hago, se muestran pegados así:

ingrese la descripción de la imagen aquí

En mi tienda de fuego se guardó como tal:

ingrese la descripción de la imagen aquí

¿Cómo puedo separar cada valor y mostrar el ícono al lado cuando recorro la matriz e imprimo los valores?

aquí está mi código:

 const [features, setFeatures] = useState([]); const featuresList = [] const getPropertyDetails = async () => { await firebase.firestore().collection("Properties").where("propertyID","==",propID).get().then((snapshot) => { snapshot.forEach((doc) => { const {features} = doc.data(); featuresList.push({ features:features, }) setFeatures(featuresList) }) }) } useEffect(() => { getPropertyDetails() },[]) return ( <div className="property-news-single-card border-bottom-yellow"> <h4>Features</h4> <div className="row"> <div className="col-sm-4"> <ul className="rld-list-style mb-3 mb-sm-0"> {features.map((feature,i) => ( <li><i className="fa fa-check" />{feature.features}</li> )) } </ul> </div> </div> </div> )
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Resolví el problema de esta manera, solo tenía que mapear los datos y luego mapear la matriz de características y devolver el valor.

 <ul className="rld-list-style mb-3 mb-sm-0"> {data.map((item,i) => ( item.features.map((feature,i) => { return ( <li><i className="fa fa-check" />{feature}</li> ) }) )) } </ul>
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!