deep-foundation / deep-foundation/store

useCapacitorStore is not rerendered on changes made by Preferences.set

Open
#21 0 comments 0 reactions 1 assignee Claimed by @FreePhoenix888 View on GitHub
bug
Dominant language
TypeScript
Stars
7
Forks
3
PR merge metrics
No merged PRs in 30d

Description

# How to reprodouce
```tsx
import React from "react";
import {
CapacitorStoreProvider,
useCapacitorStore,
} from "@deep-foundation/store/capacitor";
import {
Card,
CardBody,
CardHeader,
ChakraProvider,
FormControl,
FormLabel,
Heading,
Stack,
Switch,
Text,
} from "@chakra-ui/react";
import { Preferences } from "@capacitor/preferences";

function Content() {
const key = "aaa";
const [state, setState] = useCapacitorStore(key, "false");

return (

State: {state.toString()}


Data Synchronization




Synchronize All Data

{
const { checked } = event.target;
Preferences.set({ key: key, value: checked.toString() });
}}
/>




);
}

export default function IndexPage() {
return (





);
}

```

# Additional Info
[Screencast from 11-22-2023 03:05:30 AM.webm](https://github.com/deep-foundation/store/assets/66206278/f08204be-664c-4188-b162-c5b0cfbfdf13)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.