I have been getting errors on the code below. How do I fix it, please???. The issue is on line 22. It's not compiling on npm//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
import React from 'react';
import Particles from 'react-particles-js';
import Navigation from './components/Navigation/Navigation';
import Logo from './components/Logo/Logo';
import Rank from './components/Rank/Rank';
import ImageLinkForm from './components/ImageLinkForm/ImageLinkForm';
import './App.css';
const particlesOptions = {
particles: {
number: {
value: 30,
density: {
enable: true,
value_area: 800
}
}
}
}
function App() {
constructor() {
super();
this.state = {
input: '',
}
}
onInputChange = (event) => {
console.log(event);
}
return (
<div className="App">
<Particles className='particles'
params={particlesOptions}
/>
<Navigation />
<Logo />
<Rank />
<ImageLinkForm onInputChange={this.onInputChange}/>
{/*<FaceRecognition />*/}
</div>
);
}
export default App;
constructordoing inside a function ? Just remove it, or convert the function to aClass(and add arendermethod).Functional ComponentsandClass Components. Functional components are more popular now, but you should make sure you know the difference. The constructor() function used to be very popular in class components, but it's not used in functional components.