Skip to content

Commit 0f49482

Browse files
committed
reordered app provider hooks
1 parent a90048b commit 0f49482

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

source/frameworks/react/providers-hooks.txt

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ to configure a realm or exposing more than one realm, refer to their respective
182182
Working with Providers using Hooks
183183
----------------------------------
184184

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>`.
186186

187187
Hooks act as functions used to access states in your app. React offers built-in hooks you can
188188
use either on their own or to build custom hooks.
@@ -315,6 +315,28 @@ use in any wrapped component.
315315

316316
.. _react-native-use-auth:
317317

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+
318340
useAuth()
319341
~~~~~~~~~
320342

@@ -675,28 +697,6 @@ use in any wrapped component.
675697
- ``restArgs``. Additional arguments that you need to pass to your custom
676698
reset password function.
677699

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-
700700
.. tab:: UserProvider Hooks
701701
:tabid: user-provider-hooks
702702

0 commit comments

Comments
 (0)