Error:
ash11055201 opened this issue · comments
i'm following React course.There is an error that i have been for over an hour.Can anyone please solve this..
I want to extend Component of react class to create a search bar but can't do it:
Code for search_bar:
`import React, {'Component'} from 'react';
const SearchBar extends Component {
render() {
return <input onChange={(event) => console.log(event.target.value)} />;
}
}
export default SearchBar;
`
Code of index:
`import React from 'react';
import ReactDOM from 'react-dom';
import SearchBar from './components/search_bar';
const API_KEY='AIzaSyCoeaT4zM-lPerhzktn9GKQHEQdQXWFIdE';
//create a new component
const App=() => {
return (
Please solve this as soon as possivle :p
change your
import React, {'Component'} from 'react';
to
import React, { Component } from 'react';
the single quotes is not needed.