Expected an assignment or function call and instead saw an expression

Oct 3 2023 3:48 AM

I am very new to react, and even custom code as a whole. I am trying something very simple:

I want to set a property in one Javascript file, and reference that property (and the value it contains) in another javascript file.

I have attached the code below I am referring to. I continue to get the error in reference to my challenge.js file, "Expected an assignment or function call and instead saw an expression."

//App.js
import './App.css';
import'./challenges.js';
???????function App() {
  return (
    <div>
      <header>
        {challenge1}
      </header>
    </div>
  );
}
export default App;
//challenge.js
const challenge1="Hello World";
exports.module

 


Answers (1)