Singleton realm instance

How can we share realm instance in different components when it is open via
I mean how can I make it singleton and share it in different components(Node js sdk).

I’m using React and the way I did this was to create a RealmContext/Provider. They discussed this approach in a recent webinar on YouTube: Realm Meetup - Realm JavaScript for React Native applications - YouTube