Skip to content

Commit 5d0632f

Browse files
committed
Revert "checkpoint: RN types on useUser"
This reverts commit 14e60f7.
1 parent 14e60f7 commit 5d0632f

File tree

1 file changed

+0
-30
lines changed

1 file changed

+0
-30
lines changed

examples/react-native/__tests__/ts/app-services/atlas-functions.test.tsx

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,12 @@ function MyApp() {
3434
<UserProvider>
3535
<Text>Foo!</Text>
3636
<Addition />
37-
<AdditionWithTypes />
3837
</UserProvider>
3938
</View>
4039
) : null;
4140
}
4241

4342
let higherScopedSum: number;
44-
let typedHigherScopedSum: number;
4543
// :remove-end:
4644

4745
function Addition() {
@@ -70,27 +68,6 @@ function Addition() {
7068
// :remove-end:
7169
}
7270
// :snippet-end:
73-
// :snippet-start: addition-with-types
74-
type FunctionTypes = {
75-
sum: (a: number, b: number) => number;
76-
} & Realm.DefaultFunctionsFactory;
77-
78-
function AdditionWithTypes() {
79-
const user = useUser<FunctionTypes, SimpleObject, Realm.DefaultUserProfileData>();
80-
async function addNumbers(numA: number, numB: number) {
81-
const sum = await user?.functions.sum(numA, numB);
82-
// :remove-start:
83-
expect(sum).toBe(3);
84-
typedHigherScopedSum = sum as number;
85-
// :remove-end:
86-
return sum;
87-
}
88-
// ...
89-
// :remove-start:
90-
return <Button onPress={() => addNumbers(1, 2)} testID='test-typed-function-call' title='Test Me!' />;
91-
// :remove-end:
92-
}
93-
// :snippet-end:
9471

9572
afterEach(async () => await App.getApp(APP_ID).currentUser?.logOut());
9673

@@ -101,10 +78,3 @@ test('Call Atlas Function', async () => {
10178
fireEvent.press(button);
10279
await waitFor(() => expect(higherScopedSum).toBe(3));
10380
});
104-
test('Call Typed Atlas Function', async () => {
105-
const {getByTestId} = render(<AppWrapper />);
106-
107-
const button = await waitFor(() => getByTestId('test-typed-function-call'));
108-
fireEvent.press(button);
109-
await waitFor(() => expect(higherScopedSum).toBe(3));
110-
});

0 commit comments

Comments
 (0)