Browse Source

simplify condition

Jordan Sexton 3 years ago
parent
commit
123ea5aa28
1 changed files with 1 additions and 1 deletions
  1. 1 1
      packages/core/react/src/useLocalStorage.ts

+ 1 - 1
packages/core/react/src/useLocalStorage.ts

@@ -15,7 +15,7 @@ export function useLocalStorage<T>(key: string, defaultState: T): [T, React.Disp
 
     const isFirstRender = useRef(true);
     useEffect(() => {
-        if (isFirstRender.current === true) {
+        if (isFirstRender.current) {
             isFirstRender.current = false;
             return;
         }