mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 21:27:05 +00:00
useLocationHash dropped
This commit is contained in:
parent
4ef7b4a85a
commit
494f48e23c
2 changed files with 0 additions and 19 deletions
|
|
@ -23,7 +23,6 @@ const useDeepEqualState = require('./useDeepEqualState');
|
|||
const useFullscreen = require('./useFullscreen');
|
||||
const useInLibrary = require('./useInLibrary');
|
||||
const useLiveRef = require('./useLiveRef');
|
||||
const useLocationHash = require('./useLocationHash');
|
||||
const useModelState = require('./useModelState');
|
||||
const useSpreadState = require('./useSpreadState');
|
||||
const useUser = require('./useUser');
|
||||
|
|
@ -54,7 +53,6 @@ module.exports = {
|
|||
useFullscreen,
|
||||
useInLibrary,
|
||||
useLiveRef,
|
||||
useLocationHash,
|
||||
useModelState,
|
||||
useSpreadState,
|
||||
useUser
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
const React = require('react');
|
||||
|
||||
const useLocationHash = () => {
|
||||
const [locationHash, setLocationHash] = React.useState(window.location.hash);
|
||||
React.useEffect(() => {
|
||||
const onLocationHashChange = () => {
|
||||
setLocationHash(window.location.hash);
|
||||
};
|
||||
window.addEventListener('hashchange', onLocationHashChange);
|
||||
return () => {
|
||||
window.removeEventListener('hashchange', onLocationHashChange);
|
||||
};
|
||||
}, []);
|
||||
return locationHash;
|
||||
};
|
||||
|
||||
module.exports = useLocationHash;
|
||||
Loading…
Reference in a new issue