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

312
Views
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
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!