@@ -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
2626develop a React app. The components leverage the Provider design pattern to manage user
2727creation, user authentication, and data management.
2828
@@ -38,12 +38,52 @@ The Providers are available to all frameworks used to build with the JavaScript
3838Configure 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
4888You can configure a ``RealmProvider`` in two ways:
4989
0 commit comments