-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
1 parent
6ffd8b5
commit c2b6210
Showing
16 changed files
with
982 additions
and
2 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
source/examples/generated/react/providers-hooks.snippet.use-providers.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React from "react"; | ||
import { APP_ID } from "../realm.config.json"; | ||
import { AppProvider, UserProvider, RealmProvider, useRealm, useUser } from "@realm/react"; | ||
|
||
export const AppWrapper = () => { | ||
return ( | ||
<AppProvider id={APP_ID}> {/* pass in your App ID as a prop */} | ||
<UserProvider> | ||
<RealmProvider> | ||
{/* call any app components here */} | ||
</RealmProvider> | ||
</UserProvider> | ||
</AppProvider> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
.. _sdks-build-with-react: | ||
|
||
================ | ||
Build with React | ||
================ | ||
|
||
.. contents:: On this page | ||
:local: | ||
:backlinks: none | ||
:depth: 2 | ||
:class: singlecol | ||
|
||
.. toctree:: | ||
:titlesonly: | ||
|
||
Install </frameworks/react/install> | ||
Quick Start </frameworks/react/quick-start> | ||
Providers & Hooks </frameworks/react/providers-hooks> | ||
Model Data </frameworks/react/model-data> | ||
Open & Manage Database Files </frameworks/react/manage-database-files> | ||
Read & Write Data </frameworks/react/read-write> | ||
React to Changes </frameworks/react/react-to-changes> | ||
Access Atlas </frameworks/react/access-atlas> | ||
Manage Users </frameworks/react/manage-users> | ||
Sync Data </frameworks/react/sync-data> | ||
Test & Debug </frameworks/react/test-debug> | ||
API Reference </frameworks/react/api-reference> | ||
|
||
Placeholder page for information about building with React. (This may | ||
be a directory depending on how much content we have/need.) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
.. _sdks-react-access-atlas: | ||
|
||
============ | ||
Access Atlas | ||
============ | ||
|
||
.. contents:: On this page | ||
:local: | ||
:backlinks: none | ||
:depth: 2 | ||
:class: singlecol | ||
|
||
Placeholder page for information about building with @realm/react. (This may | ||
be a directory as we have two pages for this?) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.. _sdks-react-api-reference: | ||
|
||
=================================== | ||
API Reference | ||
=================================== | ||
|
||
.. toctree:: | ||
:titlesonly: | ||
|
||
JavaScript SDK Reference (@realm) <https://www.mongodb.com/docs/realm-sdks/js/latest/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
.. _sdks-react-install: | ||
|
||
=================================== | ||
Install @realm/react in a React App | ||
=================================== | ||
|
||
.. contents:: On this page | ||
:local: | ||
:backlinks: none | ||
:depth: 2 | ||
:class: singlecol | ||
|
||
Placeholder page for information about building with @realm/react. (This may | ||
be a directory as we have two pages for this?) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
.. _sdks-react-manage-database-files: | ||
|
||
============================ | ||
Open & Manage Database Files | ||
============================ | ||
|
||
.. contents:: On this page | ||
:local: | ||
:backlinks: none | ||
:depth: 2 | ||
:class: singlecol | ||
|
||
Placeholder page for information about building with @realm/react. (This may | ||
be a directory as we have two pages for this?) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
.. _sdks-react-manage-users: | ||
|
||
============ | ||
Manage Users | ||
============ | ||
|
||
.. contents:: On this page | ||
:local: | ||
:backlinks: none | ||
:depth: 2 | ||
:class: singlecol | ||
|
||
Placeholder page for information about building with @realm/react. (This may | ||
be a directory as we have two pages for this?) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
.. _sdks-react-model-data: | ||
|
||
========== | ||
Model Data | ||
========== | ||
|
||
.. contents:: On this page | ||
:local: | ||
:backlinks: none | ||
:depth: 2 | ||
:class: singlecol | ||
|
||
Placeholder page for information about building with @realm/react. (This may | ||
be a directory as we have two pages for this?) |
Oops, something went wrong.