Skip to content

Commit

Permalink
Add suggested work-around for Mosaic error
Browse files Browse the repository at this point in the history
  • Loading branch information
gjvoosten committed Jul 21, 2022
1 parent f28211f commit c602d23
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions client/src/components/MosaicLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import {
getNodeAtPath,
getOtherDirection,
getPathToCorner,
Mosaic,
MosaicWindow,
MosaicWithoutDragDropContext,
updateTree
} from "react-mosaic-component"
import "react-mosaic-component/react-mosaic-component.css"
Expand All @@ -29,7 +29,7 @@ const MosaicLayout = ({ visualizations, initialNode, description, style }) => {
<div className="mosaic-box" style={style}>
<div className="mosaic-container">
{renderNavBar()}
<Mosaic
<MosaicWithoutDragDropContext
value={currentNode}
onChange={updateCurrentNode}
renderTile={(id, path) => {
Expand Down
10 changes: 7 additions & 3 deletions client/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { jumpToTop } from "components/Page"
import "locale-compare-polyfill"
import App from "pages/App"
import React from "react"
import { DndProvider } from "react-dnd-multi-backend"
import HTML5ToTouch from "react-dnd-multi-backend/dist/cjs/HTML5toTouch"
import { createRoot } from "react-dom/client"
import { Provider } from "react-redux"
import { BrowserRouter, Route } from "react-router-dom"
Expand All @@ -28,9 +30,11 @@ root.render(
<Provider store={store}>
<PersistGate persistor={persistor}>
<ApolloProvider client={API.client}>
<BrowserRouter onUpdate={jumpToTop}>
<Route path="/" component={App} />
</BrowserRouter>
<DndProvider options={HTML5ToTouch}>
<BrowserRouter onUpdate={jumpToTop}>
<Route path="/" component={App} />
</BrowserRouter>
</DndProvider>
</ApolloProvider>
</PersistGate>
</Provider>
Expand Down

0 comments on commit c602d23

Please sign in to comment.