mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-26 04:50:36 +03:00
R: make react-scan import optional
This commit is contained in:
parent
00a64e90f1
commit
1afc179d06
|
@ -1,15 +1,16 @@
|
||||||
import { createRoot } from 'react-dom/client';
|
import { createRoot } from 'react-dom/client';
|
||||||
import { scan } from 'react-scan';
|
|
||||||
|
|
||||||
import { GlobalProviders } from './app/GlobalProviders';
|
import { GlobalProviders } from './app/GlobalProviders';
|
||||||
import { App } from './app';
|
import { App } from './app';
|
||||||
|
|
||||||
import './index.css';
|
import './index.css';
|
||||||
|
|
||||||
if (typeof window !== 'undefined') {
|
if (typeof window !== 'undefined' && !!process.env.NODE_ENV && process.env.NODE_ENV === 'development') {
|
||||||
scan({
|
void import('react-scan').then(module =>
|
||||||
enabled: !!process.env.NODE_ENV && process.env.NODE_ENV === 'development'
|
module.scan({
|
||||||
});
|
enabled: true
|
||||||
|
})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
createRoot(document.getElementById('root')!).render(
|
createRoot(document.getElementById('root')!).render(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user