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

RNN and Realm integration #7804

Open
1 task done
tab opened this issue Nov 1, 2023 · 1 comment
Open
1 task done

RNN and Realm integration #7804

tab opened this issue Nov 1, 2023 · 1 comment

Comments

@tab
Copy link

tab commented Nov 1, 2023

What happened?

Hey there,
I would like to report an issue that I've encountered while develop my app.

Here is the error log:

info Reloading app...
BUNDLE  ./index.js

LOG  Running "com.demo.Home" with {"rootTag":91,"initialProps":{"componentId":"Component1"}}
LOG  Running "com.demo.Profile" with {"rootTag":101,"initialProps":{"componentId":"Component2"}}
LOG  Running "com.demo.Search" with {"rootTag":111,"initialProps":{"componentId":"Component5"}}
ERROR  [Error: Realm at path '~/Library/Developer/CoreSimulator/Devices/80804451-2C6B-4234-A1E3-EEB10978C5D7/data/Containers/Data/Application/58C9FF7E-B06B-4C30-9366-9C10E72BD14B/Documents/mongodb-realm/devicesync-sxnya/6540f36a748707f093355a2a/s_6540f36a748707f093355a2a.realm' already opened with a different sync user.]

This error occurs when I try to open a modal using the following code:

Navigation.showModal({
  stack: {
    children: [
      {
        component: {
          name: SEARCH_SCREEN.name,
          options: SEARCH_SCREEN.options,
          passProps: {},
        },
      },
    ],
  },
})
export const SEARCH_SCREEN = {
  id: "SEARCH_SCREEN",
  name: "com.demo.Search",
  options: {
    topBar: {
      visible: false,
    },
    bottomTabs: {
      visible: false,
    },
    modal: {
      swipeToDismiss: true,
    },
    layout: {
      backgroundColor: "transparent",
      componentBackgroundColor: "transparent",
    },
  },
}

Please let me know if you need any further information or if there's anything I can do to assist in resolving this issue.

Thank you for your attention.

What was the expected behaviour?

No response

Was it tested on latest react-native-navigation?

  • I have tested this issue on the latest react-native-navigation release and it still reproduces.

Help us reproduce this issue!

Demo application

https://github.com/tab/rnn-realm-demo

In what environment did this happen?

React Native Navigation version: 7.37.1
React Native version: 0.72.6
Has Fabric (React Native's new rendering system) enabled: no
Node version: 20.5.1

"@realm/react": "^0.6.1"
"realm": "^12.2.1"

@aight8
Copy link

aight8 commented Nov 5, 2023

Unfortunately, this is a problem with realm-js. This was designed for a single React DOM tree.

I created an issue yesterday.
realm/realm-js#6233

However it's not the full solution.
You must use e.g. mobx also (because React Context is also for a specific React DOM Tree only)

Take a look at:
https://gist.github.com/aight8/21d78a05ff0f648fb93671879b2c83aa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants