s3browser-frontend/src/index.tsx

30 lines
745 B
TypeScript
Raw Normal View History

2021-07-26 12:54:22 +00:00
import React from "react"
import ReactDOM from "react-dom"
import "./index.scss"
import App from "./App"
import { ApolloClient, ApolloProvider, InMemoryCache } from "@apollo/client"
const client = new ApolloClient({
2021-07-27 17:24:52 +00:00
uri: "/graphql",
2021-07-26 12:54:22 +00:00
cache: new InMemoryCache()
})
// Disable drag and drop behaviour on document
function disable(event: DragEvent) {
event.preventDefault()
event.stopPropagation()
}
document.addEventListener("dragenter",disable)
document.addEventListener("dragleave",disable)
document.addEventListener("dragover",disable)
document.addEventListener("drop",disable)
2021-07-26 12:54:22 +00:00
ReactDOM.render(
<React.StrictMode>
<ApolloProvider client={client}>
<App />
</ApolloProvider>
</React.StrictMode>,
document.getElementById("root")
)