I'm currently developing a NextJs application and encountered an issue with the header folder, which contains a Header.jsx file with a default export Header
.
In the same directory, there is an index.js
file with the following code:
export * from './Header'
However, when I try to use it, an error occurs:
Attempted import error: '../components/header' does not contain a default export (imported as 'Header').
If instead I use:
import Header from './Header'
export default Header
Everything works smoothly. Is there a way in NextJs to utilize the single-line export method without encountering this repetition?
Thank you