Files
plane/space/core/hooks/use-is-in-iframe.tsx
Aaryan Khandelwal c9cf7cc631 [WEB-1397] refactor: edition specific migration (#4847)
* refactor: edition specific migration

* revert: pagination from space endpoints

* fix: project publish

---------

Co-authored-by: pablohashescobar <nikhilschacko@gmail.com>
2024-06-17 20:09:15 +05:30

18 lines
334 B
TypeScript

import { useState, useEffect } from "react";
const useIsInIframe = () => {
const [isInIframe, setIsInIframe] = useState(false);
useEffect(() => {
const checkIfInIframe = () => {
setIsInIframe(window.self !== window.top);
};
checkIfInIframe();
}, []);
return isInIframe;
};
export default useIsInIframe;