I want to conditionally import react-devtools based on an environment variable but eslint says that I can't import in the body of the module when I try to import react-dom
react-devtools requires that I import it before react-dom so what do I do?
import React from 'react';
import env from 'react-dotenv'
const _temp = env.DEV === "true" && import ("react-devtools");
import ReactDOM from 'react-dom';
import App from './App';
import { RecoilRoot } from 'recoil'
It gives errors on the last three lines. How do I resolve this?
question from:
https://stackoverflow.com/questions/65840829/how-do-i-conditionally-import-react-devtools 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…