Skip to content

Commit

Permalink
Fix Back Press after Searching
Browse files Browse the repository at this point in the history
  • Loading branch information
kaamil-ahamadh committed Nov 18, 2022
1 parent 8f83f23 commit a3bc1df
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/screens/SearchResultsScreen.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
import React, { useContext } from "react";
import React, { useContext, useEffect, useState } from "react";

import GlobalContext from "../context/GlobalContext";
import { VideoCardResults } from "../components";
import { useNavigate } from "react-router-dom";

const SearchResultsScreen = () => {
const { searchResults } = useContext(GlobalContext);

const navigate = useNavigate();

useEffect(() => {
window.onpopstate = () => {
navigate("/");
};
}, []);
return (
<div>
<div className="trending-title">Search Results</div>
Expand Down

0 comments on commit a3bc1df

Please sign in to comment.