Add npm package not work

#1

I have a base component npm package, so I run like
yarn add react-native-comps
and import the file like:

import {BaseList} from 'react-native-comps';
import sss from 'react-native-comps';


console.log('<<<<', BaseList);
console.log('<<<<', sss);
console.log('<<<<', require('react-native-comps'));
console.log('<<<<', require('react-native-comps').default);

but the result is like:

Home.js:7 <<<< undefined
16:19:22.796 Home.js:8 <<<< {}
16:19:22.798 Home.js:9 <<<< {}
16:19:22.799 Home.js:10 <<<< undefined

my npm package export like:


module.exports = {
  //list
  get BaseList() {
    return require('./lists/BaseList').default;
  },
}

so how can i access my npm package?? It’s ok work with react-native only

#2

Is this in snack or in an XDE/exp project?