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

78
Vistas
Component is not rendering any record after converting into .tsx in react

I have ResultTable.jsx file.

import React, { useState } from 'react'
import { Link } from 'react-router-dom';
import Certificate from './models/certificate';
import axios from 'axios';

const ResultTable = ({certificate}) => {
    console.log(JSON.stringify(certificate));
    
     return (
        <tr key={certificate.certificateNo}>
        <td>{certificate.certificateNo}</td>
        <td>{certificate.sponser}</td>
        <td>{certificate.protoColNo}</td>
        <td>{certificate.startDate}</td>
        <td>{certificate.endDate}</td>
        <td>{certificate.noOfSubjects}</td>
        <td>{certificate.country}</td>
        <td>{certificate.requestStatus}</td>
        </tr>
      )
    
   
}

export default ResultTable

It is properly rendering record in the result table. but when I am converting it into .tsx file because my project standards,it is not rendering any record. I also changed the first line and gave type. const ResultTable = (certificate:any) when I printed in .tsx file using console.log it is printing the output.

what minor mistake I am doing? Below is .tsx file

import React, { useState } from 'react'
import { Link } from 'react-router-dom';
import Certificate from './models/certificate';

    import axios from 'axios';
    
    const ResultTable = (certificate:any) => {

        console.log(JSON.stringify(certificate));
        
         return (
            <tr key={certificate.certificateNo}>
            <td>{certificate.certificateNo}</td>
            <td>{certificate.sponser}</td>
            <td>{certificate.protoColNo}</td>
            <td>{certificate.startDate}</td>
            <td>{certificate.endDate}</td>
            <td>{certificate.noOfSubjects}</td>
            <td>{certificate.country}</td>
            <td>{certificate.requestStatus}</td>
            </tr>
          )
        
       
    }
    
    export default ResultTable
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

const ResultTable = ({certificate}) => {
const ResultTable = (certificate:any) => {

You swiched from destructuring the props to not destructuring the props. You need:

const ResultTable = ({certificate}:any) => {

And of course, this can be improved by defining a type for the props, instead of any.

about 4 years ago · Juan Pablo Isaza Denunciar
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