vega-frontend-monorepo/apps/token/src/main.tsx
m.ray 71ede25339
chore: upgrade to React 18 (#952)
* chore: upgrade react only

* chore: import renderHook from testing-library/react

* chore: add @babel/runtime to fix tests

* fix: fix some of the tests

* fix: fix some of the tests

* fix: fix tests failing on not being wrapped in act

* fix: fix tests in use-environment

* fix:  fix @types/react issue

* fix: fix formatting

* fix: remove unsued method

* fix: callout not accepting react node and root element null check

* fix: main.tsx stats null check

* fix: implicit any type fixes

* Update libs/environment/src/hooks/use-nodes.spec.tsx

* fix:  import act from testing-lib

* fix:  add strict mode back

* fix:  fix formatting issues

* fix: add babel deps for storybook

* Update tsconfig.json (#970)

* Update tsconfig.json

* feat: [console-lite] - add missing types in few places

Co-authored-by: maciek <maciek@vegaprotocol.io>

* chore(#952): remove any from useDataProvider hook

Co-authored-by: macqbat <kubat.maciek@gmail.com>
Co-authored-by: maciek <maciek@vegaprotocol.io>
Co-authored-by: Bartłomiej Głownia <bglownia@gmail.com>
2022-08-09 10:43:11 +01:00

54 lines
1.4 KiB
TypeScript

import './styles.css';
import * as Sentry from '@sentry/react';
import { Integrations } from '@sentry/tracing';
import { createRoot } from 'react-dom/client';
import App from './app';
import reportWebVitals from './report-web-vitals';
import { ENV } from './config/env';
import { StrictMode } from 'react';
const dsn = ENV.dsn || false;
const environment = ENV.envName || 'local';
const commit = ENV.commit || 'local';
const branch = ENV.branch || 'unknown';
/* istanbul ignore next */
if (dsn) {
Sentry.init({
dsn,
integrations: [new Integrations.BrowserTracing()],
tracesSampleRate: 0.1,
enabled: environment !== 'local',
environment,
release: commit,
beforeSend(event) {
if (event.request?.url?.includes('/claim?')) {
return {
...event,
request: { ...event.request, url: event.request?.url.split('?')[0] },
};
}
return event;
},
});
Sentry.setTag('branch', branch);
Sentry.setTag('commit', commit);
}
const rootElement = document.getElementById('root');
const root = rootElement && createRoot(rootElement);
root?.render(
<StrictMode>
<App />
</StrictMode>
);
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();