I have a main file 'index.js' and I want to import and use the functions in it in another js file.
I tried importing the file using require but it did not work.Can someone help me with suggestion.
Index.js,
function dcLib() {
function test() {
console.log('Hi');
}
return {
test:test
}
};
export default dcLib;
column.js,
const dcLib = require('../index');
dcLib.test()
The above code giving error as
TypeError: dcLib.test is not a function