From e2098fc2ecaec74ea02c817bc6eb42fa9da05ed1 Mon Sep 17 00:00:00 2001 From: Woo Dohyeong Date: Sun, 20 Feb 2022 21:47:03 +0900 Subject: [PATCH 1/2] fix : Changed to work only in browser(storageKey) - for nextJS --- src/localStorage/load.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/localStorage/load.js b/src/localStorage/load.js index 2d55e6843..17d82ff44 100644 --- a/src/localStorage/load.js +++ b/src/localStorage/load.js @@ -1 +1,10 @@ -export const load = storageKey => JSON.parse(window.localStorage.getItem(storageKey)); +const isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined'; + +export const load = storageKey => { + if (isBrowser) { + return JSON.parse(window.localStorage.getItem(storageKey)); + } else if (storageKey !== undefined) { + console.warn('storageKey support only on browser'); + return undefined; + } +}; From ee56bf746a547b0710d3e64b03d2f4bc11921be6 Mon Sep 17 00:00:00 2001 From: Woo Dohyeong Date: Sun, 20 Feb 2022 21:48:18 +0900 Subject: [PATCH 2/2] document : fix README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 339a454b5..5bfbfc7c0 100644 --- a/README.md +++ b/README.md @@ -247,7 +247,7 @@ The component accepts the following props: |**`tableBodyMaxHeight`**|string||CSS string for the height of the table (ex: '500px', '100%', 'auto'). |**`textLabels`**|object||User provided labels to localize text. |**`viewColumns`**|boolean or string|true|Show/hide viewColumns icon from toolbar. Possible values:

-|**`storageKey`**|string|| save current state to local storage. +|**`storageKey`**|string|| save current state to local storage(Only browser). ## Customize Columns