Search code examples
react-nativejitsi-meet

react-native-jitsi-meet module not found


I am trying to install Jitsi-Meet plugin in my react-native project. I am trying to create a video/audio conference meetup feature in a website and I want to use react-native for the same purpose.

this is the plugin link.react-native-jitsi-meet - npmjs.org

The plugin gets successfully installed in the package.json

enter image description here

But when I am trying to import in my App.tsx file, it shows me module not found

enter image description here

How can I import the plugin successfully?

Thanks in advance.


Solution

  • 1- Something is Missings

    There is missing index.js file which is mendatory for npm packge. you can see in screenshot enter image description here

    -

    2- You need to perform these steps to resolve this package

    Step 1:

    make index.js file at node_modules/react-native-jitsi-meet/index.js

    Step 2:

    and this add code in that index.js file

    import { NativeModules, requireNativeComponent } from 'react-native';
    
    export const JitsiMeetView = requireNativeComponent('RNJitsiMeetView');
    export const JitsiMeetModule = NativeModules.RNJitsiMeetView;
    const call = JitsiMeetModule.call;
    const audioCall = JitsiMeetModule.audioCall;
    JitsiMeetModule.call = (url, userInfo) => {
      userInfo = userInfo || {};
      call(url, userInfo);
    }
    JitsiMeetModule.audioCall = (url, userInfo) => {
      userInfo = userInfo || {};
      audioCall(url, userInfo);
    }
    export default JitsiMeetModule;
    
    

    enter image description here

    after these steps everything will be working

    Node: you should automate these steps when we install any package by npm or yarn

    we can use patch-package to automate these steps