I have the following in App.js
let contracts = [
{
id: "1",
name: "Lloyds",
image: ""
}
];
class App extends Component {
render() {
return (
<div>
<Header />
<Search />
<ContractsList />
<Content />
<Footer />
</div>
);
}
}
export default App;
Im trying to pass the contracts variable as a prop in my index.js file
import React from "react";
import ReactDOM from "react-dom";
import "./index.css";
import App from "./App";
import * as serviceWorker from "./serviceWorker";
import "bootstrap/dist/css/bootstrap-grid.css";
ReactDOM.render(
<React.StrictMode>
<App contracts={contracts} />
</React.StrictMode>,
document.getElementById("root")
);
but keep getting the following error:
Line 10:21: 'contracts' is not defined no-undef
how can i use the contracts variable so it can be used as a prop in other components?