Skip to content

Commit d790543

Browse files
committed
small
1 parent 34b0190 commit d790543

File tree

2 files changed

+49
-9
lines changed

2 files changed

+49
-9
lines changed

source/frameworks/react/api-reference/realm-provider.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@ All properties of :realm-react-sdk:`BaseConfiguration
3232
``RealmProvider`` has more props that define its behavior:
3333

3434
- ``fallback?: React.ComponentType<unknown> | React.ReactElement | null | undefined``
35-
3635
The fallback component to render while the Realm is opening.
37-
- ``closeOnUnmount?: boolean``
3836

37+
- ``closeOnUnmount?: boolean``
3938
Default is ``true``. If set to ``false``, realm will not close when the
4039
component unmounts.
41-
- ``realmRef?: React.MutableRefObject<Realm | null>``
4240

41+
- ``realmRef?: React.MutableRefObject<Realm | null>``
4342
A ref to the realm instance. This is useful if you need to access the realm
4443
instance outside of the scope of the realm.
44+
4545
- ``children: React.ReactNode``
4646

4747
Configure a Realm with RealmProvider

source/frameworks/react/providers-hooks.txt

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Providers & Hooks
2222
:depth: 2
2323
:class: singlecol
2424

25-
The ``@realm/react`` offers custom React components that eliminate the boilerplate needed to
25+
The ``@realm/react`` library offers custom React components that eliminate the boilerplate needed to
2626
develop a React app. The components leverage the Provider design pattern to manage user
2727
creation, user authentication, and data management.
2828

@@ -38,12 +38,52 @@ The Providers are available to all frameworks used to build with the JavaScript
3838
Configure your Providers
3939
------------------------
4040

41-
Like all React components, you call Providers using html opening and closing tags. They take
42-
parameters called Props as input, passed into the opening tag.
41+
Like all React components, you call Providers using html opening and closing tags. Nesting a
42+
component within in another component's tags creates a parent-child relationship between them,
43+
where child components can access the context created by its parent component.
4344

44-
Nesting components within each other creates a parent-child relationship between them. The
45-
props passed into the parent component help create the context inherited by the components it
46-
wraps. Thus, any component wrapped by the Providers can access their context.
45+
Props
46+
~~~~~
47+
48+
Components take parameters called Props as input, passed into the opening tag. The props passed
49+
into a parent component help create the context inherited by the components it wraps. Each
50+
Provider has different props you can use for configuration.
51+
52+
.. tabs::
53+
54+
.. tab:: RealmProvider Props
55+
:tabid: realm-provider-props
56+
57+
All properties of :realm-react-sdk:`BaseConfiguration
58+
<types/Realm.BaseConfiguration.html>` can be passed as props.
59+
60+
``RealmProvider`` has more props that define its behavior:
61+
62+
- ``fallback?: React.ComponentType<unknown> | React.ReactElement | null | undefined``
63+
The fallback component to render while the Realm is opening.
64+
65+
- ``closeOnUnmount?: boolean``
66+
Default is ``true``. If set to ``false``, realm will not close when the
67+
component unmounts.
68+
69+
- ``realmRef?: React.MutableRefObject<Realm | null>``
70+
A ref to the realm instance. This is useful if you need to access the realm
71+
instance outside of the scope of the realm.
72+
73+
- ``children: React.ReactNode``
74+
75+
.. tab:: AppProvider Props
76+
:tabid: app-provider-props
77+
78+
All properties of :realm-react-sdk:`AppConfiguration
79+
<types/Realm.AppConfiguration.html>` can be passed as props to ``AppProvider``.
80+
81+
.. tab:: UserProvider Props
82+
:tabid: user-provider-props
83+
84+
- ``fallback?: React.ComponentType<unknown> | React.ReactElement | null | undefined``
85+
The fallback component to render if there is no authorized user. This can be
86+
used to render a log in screen or otherwise handle authentication.
4787

4888
You can configure a ``RealmProvider`` in two ways:
4989

0 commit comments

Comments
 (0)