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

225
Vistas
Cell data not displayed by react-table

My data is not visible inside the react-table's cells:

import React, { useMemo } from 'react'
import { useTable } from 'react-table/dist/react-table.development'
import MOCK_DATA from '../mock/components/LandingTableMock.json'
import { COLUMNS } from './LandingTableColumns'
import '../static/styles/globalVar.css'

export const LandingTable = () => {
  
    const columns = useMemo(() => COLUMNS, [])
    const data = useMemo(() => MOCK_DATA, [])
    

    const tableInstance = useTable ({
        columns: columns, //columns: COLUMNS,
        data //data: MOCK_DATA
    })

    const { 
        getTableProps, 
        getTableBodyProps, 
        headerGroups, 
        rows, 
        prepareRow 
    } = tableInstance

    return (
        
        <table {...getTableProps()}>
            <thead>
                {
                    headerGroups.map((headerGroup) =>  (
                    <tr {...headerGroup.getHeaderGroupProps()}>
                        {
                            headerGroup.headers.map((column) => (
                                <th {...column.getHeaderProps()}> 
                                    {column.render('Header')}
                                </th>
                            )
                        )}
                    </tr>
                    ))
                }
            </thead>
            <tbody {...getTableBodyProps()}>
                {rows.map((row) => {
                    prepareRow(row)
                    return (
                        <tr {...row.getRowProps()}>
                            {row.cells.map( (cell) => {
                                return <td {...cell.getCellProps()}> {cell.render('Cell')}</td>
                            })}
                        </tr>
                    )
                })}
            </tbody>
        </table>
    )
}

I put a breakpoint to inspect the cells value and is undefined. enter image description here

MOCK_DATA and COLUMNS are looking fine, it`s not an include problem. I moved them in the same file and it still does not work.

enter image description here

The result is a table with the right number of rows but empty cells:

enter image description here

I followed this tutorial on youtube.

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