У меня в приложении следующее: js
let contracts = [
{
id: "1",
name: "Lloyds",
image: ""
}
];
class App extends Component {
render() {
return (
<div>
<Header />
<Search />
<ContractsList />
<Content />
<Footer />
</div>
);
}
}
export default App;
Я пытаюсь передать переменную контрактов в качестве опоры в моем индексе. 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")
);
, но постоянно получаю следующую ошибку:
Line 10:21: 'contracts' is not defined no-undef
как я могу использовать переменную контрактов, чтобы ее можно было использовать как опору в других компонентах?