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

225
Views
React Typescript: extraiga la tabla al componente y pase accesorios adicionales

Quiero crear componentes personalizados para table , td , tr , etc. para diseñarlos en un solo lugar. ¿Cómo especifico los accesorios para esto? El siguiente código es mi intento de lograr esto, pero recibo muchos errores que dicen que los accesorios no se pueden asignar al tipo.

 import React, { ReactNode, FC } from "react"; interface Props { children: ReactNode; } const Table: FC<Props & HTMLTableElement> = ({ children, ...rest }) => ( <table {...rest} className="min-w-full divide-y divide-gray-300"> {children} </table> ); export default Table;
about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Reemplace su FC<Props & HTMLTableElement> con:

 const Table: FC< Props & React.DetailedHTMLProps< React.TableHTMLAttributes<HTMLTableElement>, HTMLTableElement > > = ({ children, ...rest }) => ( <table {...rest} className="min-w-full divide-y divide-gray-300"> {children} </table> );

Ahora debería poder pasar todos los accesorios aceptados de <table /> .

about 4 years ago · Santiago Trujillo 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!