From 8e1b7ab2acf4b90384d17c7b0baee3d253489c6c Mon Sep 17 00:00:00 2001 From: Wessel Tip Date: Thu, 8 Feb 2024 14:05:37 +0100 Subject: [PATCH] fix(react): Adding `this.getItem()` within not found clause fixes items not showing --- .../modals/main/marketplace/sections/Marketplace.jsx | 3 +-- src/index.jsx | 10 +++------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/components/modals/main/marketplace/sections/Marketplace.jsx b/src/components/modals/main/marketplace/sections/Marketplace.jsx index 00a2f06d..1121c6f1 100644 --- a/src/components/modals/main/marketplace/sections/Marketplace.jsx +++ b/src/components/modals/main/marketplace/sections/Marketplace.jsx @@ -289,9 +289,8 @@ class Marketplace extends PureComponent { ); } - // TODO: Fix marketplace not loading on react 18, this is a temporary fix but ungraceful - // this.getItems(); if (!this.state.items || this.state.items?.length === 0) { + this.getItems(); return ( <> {errorMessage( diff --git a/src/index.jsx b/src/index.jsx index eb7671ec..8cc7ca83 100644 --- a/src/index.jsx +++ b/src/index.jsx @@ -1,4 +1,4 @@ -import { render } from 'react-dom'; +import { createRoot } from 'react-dom/client'; import * as Sentry from '@sentry/react'; @@ -26,9 +26,5 @@ Sentry.init({ }); const container = document.getElementById('root'); -render(, container); - -// TODO: Fix marketplace not loading on react 18 before upgrading -// import { createRoot } from 'react-dom/client'; -// const root = createRoot(container); -// root.render(); +const root = createRoot(container); +root.render();