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

184
Views
Change function component to class component syntax error

I am building a project in react and tried to change a functional component to class component in order to use this.state etc... However, I am receiving an error Missing semicolon. (22.11). How can I fix this in order to continue my project? This is my code:

import React from 'react'

import Navigation from './components/Navigation/Navigation'
import LogIn from './components/LogIn/LogIn'
import Converter from './components/Converter/Converter'

import './App.css'
import 'bootstrap/dist/css/bootstrap.min.css'

class App extends Component {
  constructor() {
   super();
   this.state = {
    }
  }
}

  render () {
    return (
      <div className='App'>
        <Navigation />
        <LogIn />
        <Converter />
     </div>
   );
 }


export default App

Line 22.11 is the render word!

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

class App extends Component {
  constructor() {
   super();
   this.state = {}
  }



  render () {
    return (
      <div className='App'>
        <Navigation />
        <LogIn />
        <Converter />
     </div>
   );
 }
}


export default App

about 4 years ago · Juan Pablo Isaza Report

0

There are certain errors in code DEMO

class App extends Component {
  constructor() {
   super();
   this.state = {
    }
  }
  // }               This is extra


  render () {
    return (
      <div className='App'>
        <Navigation />
        <LogIn />
        <Converter />
     </div>
   );
 }
}                   // Add extra `}` to close class


export default App;
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!