OnPageSwitch we need not `initializeAppViewPage` but instead, only `fetchPublishedPage` this changes fixes that.
13 lines
298 B
TypeScript
13 lines
298 B
TypeScript
import { useEffect, useRef } from "react";
|
|
|
|
// Make sure to use this hook at the start of functional component
|
|
const usePrevious = <T,>(value: T): T | undefined => {
|
|
const ref = useRef<T>();
|
|
useEffect(() => {
|
|
ref.current = value;
|
|
});
|
|
return ref.current;
|
|
};
|
|
|
|
export default usePrevious;
|