mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-27 21:48:41 +02:00
Substitute for-of with forEach
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
This commit is contained in:
parent
e7e9fa78e0
commit
8a4c6ac49e
1 changed files with 2 additions and 2 deletions
|
@ -22,12 +22,12 @@ const useTabGroupChoice = (): useTabGroupChoiceReturns => {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
try {
|
try {
|
||||||
const localStorageChoices = {};
|
const localStorageChoices = {};
|
||||||
for (const storageKey of listStorageKeys()) {
|
listStorageKeys().forEach((storageKey) => {
|
||||||
if (storageKey.startsWith(TAB_CHOICE_PREFIX)) {
|
if (storageKey.startsWith(TAB_CHOICE_PREFIX)) {
|
||||||
const groupId = storageKey.substring(TAB_CHOICE_PREFIX.length);
|
const groupId = storageKey.substring(TAB_CHOICE_PREFIX.length);
|
||||||
localStorageChoices[groupId] = createStorageSlot(storageKey).get();
|
localStorageChoices[groupId] = createStorageSlot(storageKey).get();
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
setChoices(localStorageChoices);
|
setChoices(localStorageChoices);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue