@@ -182,7 +182,7 @@ to configure a realm or exposing more than one realm, refer to their respective
182
182
Working with Providers using Hooks
183
183
----------------------------------
184
184
185
- To use the Provider's context in your app's components, you can use hooks.
185
+ To use the Provider's context in your app's components, you can use :react.dev:` hooks <docs/hooks-intro.html>` .
186
186
187
187
Hooks act as functions used to access states in your app. React offers built-in hooks you can
188
188
use either on their own or to build custom hooks.
@@ -315,6 +315,28 @@ use in any wrapped component.
315
315
316
316
.. _react-native-use-auth:
317
317
318
+ useApp()
319
+ ~~~~~~~~
320
+
321
+ .. code:: typescript
322
+ :copyable: false
323
+ :caption: Type signature
324
+
325
+ useApp<FunctionsFactoryType, CustomDataType>(): Realm.App<FunctionsFactoryType, CustomDataType>
326
+
327
+ *Example*
328
+
329
+ The ``useApp()`` hook provides access to a :js-sdk:`Realm.App <classes/App.html>`
330
+ instance.
331
+
332
+ .. include:: /examples/generated/react-native/v12/use-app.snippet.import-use-app.tsx.rst
333
+ .. include:: /examples/generated/react-native/v12/use-app.snippet.use-app.tsx.rst
334
+
335
+ *Returns*
336
+
337
+ - ``Realm.App``
338
+ An instance of the current ``Realm.App`` created by ``AppProvider``.
339
+
318
340
useAuth()
319
341
~~~~~~~~~
320
342
@@ -675,28 +697,6 @@ use in any wrapped component.
675
697
- ``restArgs``. Additional arguments that you need to pass to your custom
676
698
reset password function.
677
699
678
- useApp()
679
- ~~~~~~~~
680
-
681
- .. code:: typescript
682
- :copyable: false
683
- :caption: Type signature
684
-
685
- useApp<FunctionsFactoryType, CustomDataType>(): Realm.App<FunctionsFactoryType, CustomDataType>
686
-
687
- *Example*
688
-
689
- The ``useApp()`` hook provides access to a :js-sdk:`Realm.App <classes/App.html>`
690
- instance.
691
-
692
- .. include:: /examples/generated/react-native/v12/use-app.snippet.import-use-app.tsx.rst
693
- .. include:: /examples/generated/react-native/v12/use-app.snippet.use-app.tsx.rst
694
-
695
- *Returns*
696
-
697
- - ``Realm.App``
698
- An instance of the current ``Realm.App`` created by ``AppProvider``.
699
-
700
700
.. tab:: UserProvider Hooks
701
701
:tabid: user-provider-hooks
702
702
0 commit comments