Skip to content

Commit c2b6210

Browse files
authored
Consolidation Providers and Hooks (#3356)
## Pull Request Info - SDK Docs Consolidation Jira ticket: https://jira.mongodb.org/browse/DOCSP-41470 *Staged Page* - [Providers & Hooks](https://preview-mongodbosharafmdb.gatsbyjs.io/realm/react-providers-and-hooks/frameworks/react/providers-hooks/) *Page Source* - [RealmProvider (@realm/react)](https://www.mongodb.com/docs/atlas/device-sdks/sdk/react-native/api-reference/realm-provider/) - [AppProvider (@realm/react)](https://www.mongodb.com/docs/atlas/device-sdks/sdk/react-native/api-reference/app-provider/) - [UserProvider (@realm/react)](https://www.mongodb.com/docs/atlas/device-sdks/sdk/react-native/api-reference/user-provider/) *Note* This PR is built off a previous PR, [linked here](#3339). The previous PR had feedback from the original draft and the second draft after that. The feedback from that second draft was then implemented to get what is seen here. ### PR Author Checklist Before requesting a review for your PR, please check these items: - [x] Open the PR against the `feature-consolidated-sdk-docs` branch instead of `master` - [x] Tag the consolidated page for: - genre - meta.keywords - meta.description #### Naming - [x] Update Realm naming and the language around persistence layer/local/device per [this document](https://docs.google.com/document/d/126OczVxBWAwZ4P5ZsSM29WI3REvONEr1ald-mAwPtyQ/edit?usp=sharing) - [ ] Include `.rst` files comply with [the naming guidelines](https://docs.google.com/document/d/1h8cr66zoEVeXytVfvDxlCSsUS5IZwvUQvfSCEXNMpek/edit#heading=h.ulh8b5f2hu9) #### Links and Refs - [x] Create new consolidated SDK ref targets starting with "_sdks-" for relevant sections - [x] Remove or update any SDK-specific refs to use the new consolidated SDK ref targets - [ ] [Update any Kotlin API links](https://jira.mongodb.org/browse/DOCSP-32519) to use the new Kotlin SDK roles #### Content - [ ] Shared code boxes have snippets or placeholders for all 9 languages - [ ] API description sections have API details or a generic placeholder for all 9 languages - [ ] Check related pages for relevant content to include - [ ] Create a ticket for missing examples in each relevant SDK: Consolidation Gaps epic ### Reviewer Checklist As a reviewer, please check these items: - [ ] Shared code example boxes contain language-specific snippets or placeholders for every language - [ ] API reference details contain working API reference links or generic content - [ ] Realm naming/language has been updated - [ ] All relevant content from individual SDK pages is present on the consolidated page
1 parent 6ffd8b5 commit c2b6210

16 files changed

+982
-2
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React from "react";
2+
import { APP_ID } from "../realm.config.json";
3+
import { AppProvider, UserProvider, RealmProvider, useRealm, useUser } from "@realm/react";
4+
5+
export const AppWrapper = () => {
6+
return (
7+
<AppProvider id={APP_ID}> {/* pass in your App ID as a prop */}
8+
<UserProvider>
9+
<RealmProvider>
10+
{/* call any app components here */}
11+
</RealmProvider>
12+
</UserProvider>
13+
</AppProvider>
14+
);
15+
};

source/frameworks.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,22 @@ Build with Frameworks
1313
.. toctree::
1414
:titlesonly:
1515

16+
React </frameworks/react>
17+
React Native </frameworks/react-native>
1618
Electron </frameworks/electron>
1719
Flutter </frameworks/flutter>
1820
Maui </frameworks/maui>
1921
.NET </frameworks/dotnet>
20-
React Native </frameworks/react-native>
2122
SwiftUI </frameworks/swiftui>
2223

2324
The following pages contain information about building with specific
2425
frameworks using Atlas Device SDK:
2526

27+
- :ref:`sdks-build-with-react`
28+
- :ref:`sdks-build-with-react-native`
2629
- :ref:`sdks-build-with-electron`
2730
- :ref:`sdks-build-with-flutter`
2831
- :ref:`sdks-build-with-maui`
2932
- :ref:`sdks-build-with-dotnet`
3033
- :ref:`sdks-build-with-react-native`
31-
- :ref:`sdks-build-with-swiftui`
34+
- :ref:`sdks-build-with-swiftui`

source/frameworks/react.txt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
.. _sdks-build-with-react:
2+
3+
================
4+
Build with React
5+
================
6+
7+
.. contents:: On this page
8+
:local:
9+
:backlinks: none
10+
:depth: 2
11+
:class: singlecol
12+
13+
.. toctree::
14+
:titlesonly:
15+
16+
Install </frameworks/react/install>
17+
Quick Start </frameworks/react/quick-start>
18+
Providers & Hooks </frameworks/react/providers-hooks>
19+
Model Data </frameworks/react/model-data>
20+
Open & Manage Database Files </frameworks/react/manage-database-files>
21+
Read & Write Data </frameworks/react/read-write>
22+
React to Changes </frameworks/react/react-to-changes>
23+
Access Atlas </frameworks/react/access-atlas>
24+
Manage Users </frameworks/react/manage-users>
25+
Sync Data </frameworks/react/sync-data>
26+
Test & Debug </frameworks/react/test-debug>
27+
API Reference </frameworks/react/api-reference>
28+
29+
Placeholder page for information about building with React. (This may
30+
be a directory depending on how much content we have/need.)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.. _sdks-react-access-atlas:
2+
3+
============
4+
Access Atlas
5+
============
6+
7+
.. contents:: On this page
8+
:local:
9+
:backlinks: none
10+
:depth: 2
11+
:class: singlecol
12+
13+
Placeholder page for information about building with @realm/react. (This may
14+
be a directory as we have two pages for this?)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.. _sdks-react-api-reference:
2+
3+
===================================
4+
API Reference
5+
===================================
6+
7+
.. toctree::
8+
:titlesonly:
9+
10+
JavaScript SDK Reference (@realm) <https://www.mongodb.com/docs/realm-sdks/js/latest/>

source/frameworks/react/install.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.. _sdks-react-install:
2+
3+
===================================
4+
Install @realm/react in a React App
5+
===================================
6+
7+
.. contents:: On this page
8+
:local:
9+
:backlinks: none
10+
:depth: 2
11+
:class: singlecol
12+
13+
Placeholder page for information about building with @realm/react. (This may
14+
be a directory as we have two pages for this?)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.. _sdks-react-manage-database-files:
2+
3+
============================
4+
Open & Manage Database Files
5+
============================
6+
7+
.. contents:: On this page
8+
:local:
9+
:backlinks: none
10+
:depth: 2
11+
:class: singlecol
12+
13+
Placeholder page for information about building with @realm/react. (This may
14+
be a directory as we have two pages for this?)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.. _sdks-react-manage-users:
2+
3+
============
4+
Manage Users
5+
============
6+
7+
.. contents:: On this page
8+
:local:
9+
:backlinks: none
10+
:depth: 2
11+
:class: singlecol
12+
13+
Placeholder page for information about building with @realm/react. (This may
14+
be a directory as we have two pages for this?)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.. _sdks-react-model-data:
2+
3+
==========
4+
Model Data
5+
==========
6+
7+
.. contents:: On this page
8+
:local:
9+
:backlinks: none
10+
:depth: 2
11+
:class: singlecol
12+
13+
Placeholder page for information about building with @realm/react. (This may
14+
be a directory as we have two pages for this?)

0 commit comments

Comments
 (0)