• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: Creating a File that Imports & Immediately Exports Components Again

Resolved: Creating a File that Imports & Immediately Exports Components Again

0
By Isaac Tonny on 17/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

Not sure why this isn’t working. I used to have
Now I want to outsource the MDXComponents object, as it is getting too big. So I created a new file:
And then back in file 1 I do:
It doesn’t let me do this, but I am not sure why?

Answer:

When you do this:
You set the default export to a new object that has 2 properties. You’d need to import like so:
When you do this:
You create two named exports that you can import like so:
For this use-case there’s also a shortcut:

If you have better answer, please add a comment about this, thank you!

javascript next.js node.js reactjs
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: Table data is coming as empty in React

02/04/2023

Resolved: In a Pinescript v5 Strategy why is my bool not working?

02/04/2023

Resolved: net::ERR_HTTP2_PROTOCOL_ERROR by http get request angular 15.2

02/04/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.