Quantcast
Channel: Unable to import directory in React - Stack Overflow
Browsing all 3 articles
Browse latest View live

Answer by MAHESH PALIWAL for Unable to import directory in React

To import every file you need to add one more slash. it should be ./util/ .You are missing a slashBy default in your case react is importing util/index.jsimport * as All from './util/'other ways...

View Article


Answer by Quentin for Unable to import directory in React

You need an index.js inside the util directory.It should import everything from all the other files and then export them again.

View Article


Unable to import directory in React

My file layout is as follows:// Folder structure:// |-src// |-util// |-index.js// |-PageScreen1.js// |-PageScreen2.js (and etc...)// |-PageScreen.js// |-index.jsI would like to import all of util into...

View Article
Browsing all 3 articles
Browse latest View live


Latest Images