From ee54ad6aed66e75ff598ea01a9ca45928bfc4201 Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 17 Apr 2021 20:46:05 +0200 Subject: [PATCH] Fix incorrect use of Storage API --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ddf4c73..cffe276 100644 --- a/README.md +++ b/README.md @@ -19,12 +19,12 @@ npm install @capacitor-community/react-hooks ``` Import the hooks from their own path: -`import { useStorage } from '@capacitor-community/react-hooks/storage'` +`import { useStorageItem } from '@capacitor-community/react-hooks/storage'` Then use the hooks from that namespace in your app: ```jsx -const [value, setValue] = useStorage('mykey'); +const [value, setValue] = useStorageItem('mykey'); ``` ## Feature Detection @@ -35,9 +35,9 @@ Each of the hook plugin paths exports an `availableFeatures` object, which conta ```jsx const { useStorageItem, availableFeatures } = `@capacitor-community/react-hooks/storage`; -const [value, setValue] = useStorage('mykey'); +const [value, setValue] = useStorageItem('mykey'); ... -if(availableFeatures.useStorage) { +if (availableFeatures.useStorage) { setValue('cake'); } ```