Skip to content

Commit

Permalink
No destructuring returns from dynamic json imports
Browse files Browse the repository at this point in the history
  • Loading branch information
noahm committed May 30, 2023
1 parent 0af6529 commit 83d2bbf
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/draw-state.tsx
Expand Up @@ -48,9 +48,11 @@ export const useDrawState = createStore<DrawState>((set, get) => ({
});
writeDataSetToUrl(dataSetName);

const { default: data } = await import(
/* webpackChunkName: "songData" */ `./songs/${dataSetName}.json`
);
const data = (
await import(
/* webpackChunkName: "songData" */ `./songs/${dataSetName}.json`
)
).default;
set({
gameData: data,
drawings: [],
Expand Down

0 comments on commit 83d2bbf

Please sign in to comment.