feat: page tab context (#845)

* feat: page list tab context added

* fix: build fix
This commit is contained in:
Anmol Singh Bhatia 2023-04-17 13:30:39 +05:30 committed by GitHub
parent 365c758a25
commit 3f401b0fc5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 43 additions and 1 deletions

View file

@ -1,6 +1,7 @@
import { useState, useEffect, useCallback } from "react";
const getValueFromLocalStorage = (key: string, defaultValue: any) => {
if (typeof window === undefined || typeof window === "undefined") return defaultValue;
try {
const item = window.localStorage.getItem(key);
return item ? JSON.parse(item) : defaultValue;