From 956a75c7549bd0a8d1af6a66ae9c66525ea19653 Mon Sep 17 00:00:00 2001 From: Wes Weitzel Date: Sat, 14 Oct 2023 13:37:38 -0700 Subject: [PATCH] Remove useCallback (#68) --- src/pages/Fixture.tsx | 9 +++------ src/pages/Goal.tsx | 6 ++---- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/pages/Fixture.tsx b/src/pages/Fixture.tsx index ae7a176..7a969f0 100644 --- a/src/pages/Fixture.tsx +++ b/src/pages/Fixture.tsx @@ -1,8 +1,8 @@ import {useNavigate, useParams} from 'react-router-dom'; -import {useCallback, useEffect, useState} from 'react'; -import {GetFixtureResponse, getFixture as _getFixture} from '../lib/api/fixtures'; +import {useEffect, useState} from 'react'; +import {GetFixtureResponse, getFixture} from '../lib/api/fixtures'; import {Header} from '../components/Header'; -import {GetGoalsResponse, getGoals as _getGoals} from '../lib/api/goals'; +import {GetGoalsResponse, getGoals} from '../lib/api/goals'; import {getPreferredTheme} from '../lib/utils'; import Video from '../components/Video'; import {FixtureRow} from '../components/FixturesList'; @@ -11,9 +11,6 @@ function Fixture() { const {fixtureId} = useParams(); const navigate = useNavigate(); - const getFixture = useCallback(_getFixture, []); - const getGoals = useCallback(_getGoals, []); - const [getFixtureResponse, setGetFixtureResponse] = useState(); const [getGoalsResponse, setGetGoalsResponse] = useState(); diff --git a/src/pages/Goal.tsx b/src/pages/Goal.tsx index 6e725ab..00180c8 100644 --- a/src/pages/Goal.tsx +++ b/src/pages/Goal.tsx @@ -1,8 +1,8 @@ import '../index.css'; -import {getGoal as _getGoal, GetGoalResponse} from '../lib/api/goals'; +import {getGoal, GetGoalResponse} from '../lib/api/goals'; import Video from '../components/Video'; -import {useCallback, useEffect, useState} from 'react'; +import {useEffect, useState} from 'react'; import {useNavigate, useParams} from 'react-router-dom'; import {Header} from '../components/Header'; import {getPreferredTheme} from '../lib/utils'; @@ -11,8 +11,6 @@ function Goal() { const {goalId} = useParams(); const navigate = useNavigate(); - const getGoal = useCallback(_getGoal, []); - const [getGoalResponse, setGetGoalResponse] = useState(); function navigateHome() {