I'm trying to install Realm in my React Native project. I have done everything and created another file for creating the context in Realm. Here's the realm context file:
import {Realm} from '@realm/react';import {createRealmContext} from '@realm/react';class Movie extends Realm.Object<Movie> { description!: string; title!:string; releaseyear!: number; userId!: string; constructor(realm: Realm, description: string, title:string, releaseyear: number, userId?: string) { super(realm, {description, title, releaseyear, userId: userId || '_SYNC_DISABLED_'}); } }const realmContext = createRealmContext({ schema: [Movie] });export default realmContextAfter this, i'm just wrapping the context provider in App.js like this:
import {realmContext} from "./src/hooks/Realm";const App = observer(() => { const scheme = useColorScheme(); const isDarkMode = scheme === "dark"; const {RealmProvider} = realmContext // this is line from where the error is coming React.useEffect(() => { StatusBar.setBarStyle(isDarkMode ? "light-content" : "dark-content"); if (isAndroid) { StatusBar.setBackgroundColor("rgba(0,0,0,0)"); StatusBar.setTranslucent(true); } }, [scheme, isDarkMode]); return (<><RealmProvider><Navigation /></RealmProvider></> );});export default App;Now where am i going wrong. I am getting the error "Super expression must be null or a function". Thanks in advance.






