Fix broken routing by unifying game state via Context API
This commit is contained in:
parent
6fc0820831
commit
82cae002f8
8 changed files with 53 additions and 20 deletions
|
|
@ -1,9 +1,9 @@
|
|||
import React from 'react';
|
||||
import { Game } from '../../types';
|
||||
import useGameState from '../../hooks/useGameState';
|
||||
import { useGameStateContext } from '../../context/GameStateContext';
|
||||
|
||||
const HistoryScreen: React.FC = () => {
|
||||
const { gameState, setCurrentScreen } = useGameState();
|
||||
const { gameState, setCurrentScreen } = useGameStateContext();
|
||||
|
||||
const renderHistory = () => {
|
||||
if (!gameState.gameHistory || gameState.gameHistory.length === 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue