refactor: optimize component rendering with memoization and improve state management
- Added memoization to ChatHistoryPanel, ChatMessageList, and TaskBoard components to prevent unnecessary re-renders. - Refactored HomePage to utilize useMemo for derived state calculations, enhancing performance. - Updated main.tsx to conditionally render React.StrictMode based on the environment. - Improved chat and channel store hooks to allow for selector functions, enhancing flexibility in state selection. - Enhanced streaming message handling in chat store to manage pending deltas more effectively. - Refactored LoginPage to include animated decorations for improved user experience. - Implemented lazy loading for routes in the router to optimize initial load time.
This commit is contained in:
12
src/main.tsx
12
src/main.tsx
@@ -9,8 +9,14 @@ if (!container) {
|
||||
throw new Error('Missing #app container for React entry.');
|
||||
}
|
||||
|
||||
const app = <App />;
|
||||
|
||||
ReactDOM.createRoot(container).render(
|
||||
<React.StrictMode>
|
||||
<App />
|
||||
</React.StrictMode>,
|
||||
import.meta.env.DEV
|
||||
? app
|
||||
: (
|
||||
<React.StrictMode>
|
||||
{app}
|
||||
</React.StrictMode>
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user