Skip to content

Commit 75bf540

Browse files
authored
chore(react-core): update useDataState for RN compat (#6445)
1 parent 818e05a commit 75bf540

File tree

4 files changed

+7
-17
lines changed

4 files changed

+7
-17
lines changed

.changeset/chatty-cycles-roll.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@aws-amplify/ui-react-core": patch
3+
---
4+
5+
chore(react-core): update useDataState for RN compat

packages/react-core/src/hooks/useDataState/__tests__/useDataState.native.spec.ts

Lines changed: 0 additions & 12 deletions
This file was deleted.

packages/react-core/src/hooks/useDataState/useDataState.native.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

packages/react-core/src/hooks/useDataState/useDataState.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ export default function useDataState<T, K>(
3232
}));
3333

3434
const prevData = React.useRef(initialData);
35-
const pendingId = React.useRef<string | undefined>();
35+
const pendingId = React.useRef<Symbol | undefined>();
3636

3737
const { onSuccess, onError } = options ?? {};
3838

3939
const handleAction: (input: K) => void = React.useCallback(
4040
(input) => {
41-
const id = crypto.randomUUID();
41+
const id = Symbol();
4242
pendingId.current = id;
4343

4444
setDataState(({ data }) => ({ ...LOADING_STATE, data }));

0 commit comments

Comments
 (0)