В React.js при попытке перебросить const gameSettings (строка 09) в компонент < Game /> (строка 35) вылазит ошибка "Failed to compile
./src/app.js
Line 38:27: 'gameSettings' is not defined no-undef
Search for the keywords to learn more about each error."
Помогите, знатоки. Что не так?
import React, { Component } from 'react';
import Game from './components/game/game';
export default class App extends Component {
async componentDidMount() {
const response = await
fetch ('URL');
const gameSettings = await response.json();
}
render() {
return (
<div>
<div className="d-flex">
<div>
<label>choose level: </label>
<select>
<option value="low">Low</option>
<option value="average">Average</option>
<option value="High">High</option>
</select>
</div>
<div>
<input placeholder='User Name' type='text'></input>
</div>
<div>
<button>Play</button>
</div>
<div>
</div>
</div>
< Game x={gameSettings} />
</div>
);
}
}