Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@realm/react AppProvider and useApp #4470

Merged
merged 6 commits into from
Apr 27, 2022
Merged

Conversation

takameyer
Copy link
Contributor

@takameyer takameyer commented Apr 4, 2022

What, How & Why?

Create a provider component that opens a Realm.App with a given
configuration.
Create a hook to access the app component.

This closes #4456

☑️ ToDos

  • 📝 Changelog entry
  • 📝 Compatibility label is updated or copied from previous entry
  • 🚦 Tests
  • 📱 Check the React Native/other sample apps work if necessary
  • 📝 Public documentation PR created or is not necessary
  • 💥 Breaking label has been applied or is not necessary

If this PR adds or changes public API's:

  • typescript definitions file is updated
  • jsdoc files updated
  • Chrome debug API is updated if API is available on React Native

@cla-bot cla-bot bot added the cla: yes label Apr 4, 2022
@takameyer takameyer marked this pull request as ready for review April 5, 2022 08:47
// Add your Realm App ID here if sync is enabled.
appId: '<Your App ID>',
appId: 'realmtemplate-waxdf',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙃

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everytime 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

git update-index --assume-unchanged [ ...]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps it is worth modifying this to use an environment variable (and then e.g. have a .env file with your app id in which can be gitignored)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. It's probably best practice to inject your app id through an env var anyway.

Copy link
Contributor

@tomduncalf tomduncalf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good but just some small things

packages/realm-react/src/AppProvider.tsx Outdated Show resolved Hide resolved
packages/realm-react/src/AppProvider.tsx Outdated Show resolved Hide resolved
packages/realm-react/src/AppProvider.tsx Outdated Show resolved Hide resolved
example/app/AppSync.tsx Outdated Show resolved Hide resolved
example/sync.config.js Outdated Show resolved Hide resolved
takameyer and others added 6 commits April 26, 2022 12:01
Create a provider component that opens a Realm.App with a given
configuration.

Create a hook to access the app component.

Update example to show useApp usage.
Co-authored-by: Tom Duncalf <tom.duncalf@mongodb.com>
@takameyer takameyer merged commit 429df2f into master Apr 27, 2022
@takameyer takameyer deleted the andrew/rr-app-provider branch April 27, 2022 06:41
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create useApp and AppProvider
3 participants