I created a react page (localhost) to follow along with a tutorial, but my webpage is completely blank. The console shows the attached error messageenter image description here
I added
“permissions”: [
"identity",
"YourPage.com"
],
to the manifest.json file which resolved the CORS error, but the first error is still there and my page is still blank!
For the project, I ran npx create-react-app my-app in the terminal to start, then created a components folder in the src folder, where I have an index.jsx file that contains the following code for my accordion menu:
export default function Accordion() {
const [selected, setSelected] = useState(null);
return (
<div className="wrapper">
<div className="accordion">
{data && data.length > 0 ? (
data.map((dataItem) => (
<div className="item">
<div className="title">
<h3>{dataItem.question}</h3>
<span>+</span>
</div>
</div>))
) : (<div>No data found !</div>
)}
</div>
</div>
)}
this code is referencing a data.js file that contains dummy text to go into the accordion menu
then in my app.js file in the src folder, I have the following code:
import './App.css';
import Accordion from './components/accordion';
function App() {
return (
<div className="App">
{/* Accordion Component */}
<Accordion />
</div>
);
}
export default App;
I'm completely self-taught which means I think I'm missing some fundamentals to help me problem solve this, since I am following a tutorial. I already tried this tutorial yesterday and ran into the same problem, so I started over completely today and I don't know what I'm doing wrong. Any help on what I'm missing would be great!