From ad81a60d5576f650e7eaa818a49f1f8e9cd7b19a Mon Sep 17 00:00:00 2001 From: Jimmy Liow Date: Sat, 14 Sep 2024 14:36:06 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E9=A1=B6=E9=83=A8=E6=8C=89=E9=92=AE=20fix:=20=E5=90=88?= =?UTF-8?q?=E5=90=8C=E4=BF=9D=E5=AD=98=E6=88=90=E5=8A=9F=E5=90=8E=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E5=AF=B9=E8=AF=9D=E6=A1=86=20perf:=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=20main.jsx?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.jsx | 10 +++++----- src/views/App.jsx | 10 +++++++++- src/views/products/Detail/ContractRemarksModal.jsx | 1 + 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/main.jsx b/src/main.jsx index 25a7270..f9961a1 100644 --- a/src/main.jsx +++ b/src/main.jsx @@ -1,5 +1,4 @@ -import React from 'react' -import ReactDOM from 'react-dom/client' +import { createRoot } from 'react-dom/client' import { createBrowserRouter, RouterProvider, @@ -42,8 +41,6 @@ import { PERM_ACCOUNT_MANAGEMENT, PERM_ROLE_NEW, PERM_OVERSEA, PERM_AIR_TICKET, import './i18n' -const { createRoot } = ReactDOM - const initRouter = async () => { return createBrowserRouter([ { @@ -100,8 +97,11 @@ const initAppliction = async () => { } const router = await initRouter() + const root = document.getElementById('root') + + if (!root) throw new Error('No root element found') - createRoot(document.getElementById('root')).render( + createRoot(root).render( // - } onClick={() => uploadLog()} /> + + } onClick={() => uploadLog()} /> + + {contextHolder} diff --git a/src/views/products/Detail/ContractRemarksModal.jsx b/src/views/products/Detail/ContractRemarksModal.jsx index 65178ab..165b97f 100644 --- a/src/views/products/Detail/ContractRemarksModal.jsx +++ b/src/views/products/Detail/ContractRemarksModal.jsx @@ -22,6 +22,7 @@ export const ContractRemarksModal = () => { const remarkList = remarksForm.getFieldsValue().remarkList saveOrUpdateRemark(remarkList) .then(() => { + setRemarksModalOpen(false) notification.info({ message: 'Notification', description: '合同备注保存成功',