Skip to content

Commit

Permalink
fix(#749): now should work with SSR
Browse files Browse the repository at this point in the history
  • Loading branch information
xobotyi committed Nov 6, 2019
1 parent f094a3a commit c12976c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/useTitle.ts
@@ -1,11 +1,11 @@
import { useRef } from 'react';

const useTitle = (title: string) => {
function useTitle(title: string) {
const t = useRef<string>();

if (t.current !== title) {
document.title = t.current = title;
}
};
}

export default useTitle;
export default document ? useTitle : (_title: string) => {};

0 comments on commit c12976c

Please sign in to comment.