First of all, you have to import the functions/components.
import Production from "./prod"
import Development from "./dev"
Then you can check the condition, and assign the specific function/component to a variable. Finally, you can export it.
let defaultExport
if (process.env.NODE_ENV === "production") {
defaultExport = Production
} else {
defaultExport = Development
}
export default defaultExport
The full code will look like this
import Production from "./prod"
import Development from "./dev"
let defaultExport
if (process.env.NODE_ENV === "production") {
defaultExport = Production
} else {
defaultExport = Development
}
export default defaultExport