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

311
Vistas
Why api data is not rendering on my UI table altough I am able to fetch api data and sotre it using useState function

I am trying to fetch api data then show it on table format. Although I am able to fetch data and store it using useState function but it is not rendering on UI. And useState function not work on 1st render. When it 1st render transcription is empty but after 2nd render it has data but it does not show on UI. I am confused what to do. I have done the same thing in my previous pages and doesn't face any issue.

import React, { useEffect, useState } from 'react'
import _ from 'lodash'
import {
  CTable,
  CTableBody,
  CTableDataCell,
  CTableHead,
  CTableHeaderCell,
  CTableRow,
} from '@coreui/react'
import axios from 'axios'
import { useParams } from 'react-router-dom'

export default function viewMeeting() {
  const { id } = useParams()
  const [transcription, setTranscripton] = useState([])
  
  useEffect(() => {
    loadUsers()
  }, [])
  
  
  const loadUsers = async() => {
    const result = await axios.get(`http://13.212.153.21:3000/meeting?meeting_id=${id}`)
    console.log(result.data.transcriptions)
    // const data = result.data.transcriptions
    setTranscripton((result.data.transcriptions).slice(0,10))
    
  }
  console.log(transcription)
  console.log(transcription[0])
  

  return (
    <div className="container">
      <div className='vh-100 w-50 bg-white'>
          <div className='text-center'>
            <p>Matrices</p>
            </div>
            <p>Emotional Score</p>
        </div>
        <div className='vh-100 w-75'>
      <CTable>
        <CTableHead color='light'>
          <CTableRow>
            <CTableHeaderCell>Speech</CTableHeaderCell>
            <CTableHeaderCell className="text-end">Emotions</CTableHeaderCell>
          </CTableRow>
        </CTableHead>
        <CTableBody>
          {transcription.map((user, index) => {
            <CTableRow v-for="item in tableItems" key={index}>
              <CTableDataCell>{user.text}</CTableDataCell>
              <CTableDataCell>{user.response}</CTableDataCell>
            </CTableRow>
          })}
        </CTableBody>
      </CTable>
    </div>
    </div>
  )
}
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