Hi Fellow Campers!
I set up an IDE with create react app.
But I get keep getting an error: no-unused-expressions.
I am simply trying to import and display a component called Button.
I have tried different things to correct the error including:
moving the button component into the App.js and into a the same folder.
I plan to set up a Codepen React environment to see if can get past this.
Let me know if you have any thoughts.
Thanks!
App.js
import React from 'react';
//import './App.css';
import Button from './components/Button';
//class App extends React.Component {
function App() {
return (
<div className="App" id="quote-box">
<Button diplayButtonName={'click me'}/>
</div>
);
}
export default App;
Button.js
import React from 'react';
const Button = (displayButtonName) => {
<button>{displayButtonName}</button>
};
export default Button;
Then I get this error:
Failed to compile.
./src/components/Button.js
Line 4:5: Expected an assignment or function call and instead saw an expression no-unused-expressions