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

76
Views
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 answers
Answer question

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