Hello again, friends
I did a decent job my first time through, but I only ever saw a blank, white screen in my browser. In the JavaScript console, it says I have two problems in my index.js file. Here’s the kicker: I never had anything to do with the index.js file.
I watched the video tutorial on youtube, and found one spot where I had neglected to add parentheses, but it didn’t solve my problem. Following the video, I still have the same error in my browser after running npm start in the terminal.
I’ve managed to clear out one error, it was likely a default formatting error, but I can’t figure out why I can’t clear the other.
The code reads:
Warning: React.jsx: type is invalid – expected a string (for built-in components) or a class/function (for composite components) but got: object. You likely forgot to export your component from the file it’s defined in, or you might have mixed up default and named imports.
In my brain, I’m trying to import App from App.js, but when I change the import path to ‘./components/App/App’, the terminal throws a bunch of errors.
If the answer lies in a different part of the program, let me know if I should put the whole thing up on gitHub for further perusal.
Below are both my index.js, and far below, App.js.
Thank you!
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './components/App/App.css';
import reportWebVitals from './reportWebVitals';
ReactDOM.render(<App />, document.getElementById('root')); //THIS LINE is causing the error
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
import React from 'react';
//import logo from './logo.svg';
import './App.css';
import BusinessList from '../BusinessList/BusinessList';
import SearchBar from '../SearchBar/SearchBar'
class App extends React.Component {
render() {
return (
<div className="App">
<h1>ravenous</h1>
<SearchBar />
<BusinessList />
</div>
)
}
}
export default App;