excalidraw/src/index.tsx

30 lines
668 B
TypeScript
Raw Normal View History

2020-01-05 15:10:42 +01:00
import React from "react";
import ReactDOM from "react-dom";
import { TopErrorBoundary } from "./components/TopErrorBoundary";
import { IsMobileProvider } from "./is-mobile";
import { App } from "./components/App";
import "./styles.scss";
2020-01-05 15:10:42 +01:00
// Block pinch-zooming on iOS outside of the content area
document.addEventListener(
"touchmove",
function(event) {
// @ts-ignore
if (event.scale !== 1) {
event.preventDefault();
}
},
{ passive: false },
);
2020-01-05 15:10:42 +01:00
const rootElement = document.getElementById("root");
ReactDOM.render(
<TopErrorBoundary>
<IsMobileProvider>
<App />
</IsMobileProvider>
</TopErrorBoundary>,
2020-01-24 12:04:54 +02:00
rootElement,
);