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

142
Views
Error de React Fuse Component para la exportación predeterminada

Tengo este código para agregar div a la tabla al hacer clic, pero lo agregué desde Stack a un proyecto Fuse que tiene su propia plantilla. Por favor, eche un vistazo a este código, creo que hay un problema muy simple con él. Soy nuevo en React y no entiendo cómo puedo exportar la clase. Independientemente de lo que intenté, hay un error. Aquí está el código:

 const useStyles = makeStyles({ layoutRoot: {}, }); Class Mdf extends React.Component ({ getInitialState: function () { return { tablerows: [ { fname: "Tom", lname: "Moody", age: 23 } ] }; }, addRow: function () { // add new data from here var newdata = { fname: "Tom", lname: "Moody", age: 23 } //take the existing state and concat the new data and set the state again this.setState({ tablerows: this.state.tablerows.concat(newdata) }); }, rows: function () { return this.state.tablerows.map(function (row, i) { return (<tr key={i}> <td>{row.fname}</td> <td>{row.lname}</td> <td>{row.age}</td> </tr>); }); }, render: function () { const classes = useStyles(); return ( <FusePageSimple classes={{ root: classes.layoutRoot, }} header={ <div className="p-24"> <h1>Site Details</h1> </div> } contentToolbar={ <div className="px-24"> <h4>Content Toolbar22222</h4> </div> } content={ <div className="p-24"> <div> <table> <tr> <td> row 1 </td> </tr> <tr> <td> row 2 </td> </tr> <tr> <td> row 3 </td> </tr> {this.rows()} </table> <button id="addBtn" onClick={this.addRow}>ADD</button> </div> </div> } /> ); } }); // React.render(<Mdf />) export default Mdf

Y el mensaje de error que aparece es este:

 Attempted import error: './Mdf' does not contain a default export (imported as 'Mdf').
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!