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: '合同备注保存成功',