Fix circular imports causing React dispatcher null error
Build and Push Docker Image / build-and-push (push) Successful in 4m0s
Build and Push Docker Image / build-and-push (push) Successful in 4m0s
Extract shared utilities (constants, helpers, components) from App.jsx into src/utils/bibleUtils.jsx so page components can import from there instead of from App.jsx. This breaks the App.jsx <-> pages circular dependency that was triggering vite:import-analysis warnings and causing the React hook dispatcher to be null at runtime. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
c804aa2ccc
commit
b98aae741f
9 files changed
+597
-532
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import { useApp } from '../context/AppContext.js';
|
||||
import { buildExportHtml } from '../App.jsx';
|
||||
import { buildExportHtml } from '../utils/bibleUtils.jsx';
|
||||
import {
|
||||
adminDeleteUser,
|
||||
adminDeleteProject,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useApp } from '../context/AppContext.js';
|
||||
import { loginUser, registerUser, verifyMfaLogin, logoutUser } from '../syncService.js';
|
||||
import { switchStorageUser } from '../App.jsx';
|
||||
import { switchStorageUser } from '../utils/bibleUtils.jsx';
|
||||
|
||||
export default function AuthPage() {
|
||||
const {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useState } from 'react';
|
||||
import { useApp } from '../context/AppContext.js';
|
||||
import { bookOptions, CHAPTER_COUNTS, formatRelativeDate } from '../App.jsx';
|
||||
import { bookOptions, CHAPTER_COUNTS, formatRelativeDate } from '../utils/bibleUtils.jsx';
|
||||
|
||||
export default function HomePage() {
|
||||
const {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useApp } from '../context/AppContext.js';
|
||||
import { bookOptions } from '../App.jsx';
|
||||
import { bookOptions } from '../utils/bibleUtils.jsx';
|
||||
|
||||
export default function ImportPage() {
|
||||
const {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useState, useEffect, useRef } from 'react';
|
||||
import { useApp } from '../context/AppContext.js';
|
||||
import { bookOptions, BookmarkIcon, CopyIcon } from '../App.jsx';
|
||||
import { bookOptions, BookmarkIcon, CopyIcon } from '../utils/bibleUtils.jsx';
|
||||
import DrawCanvas from './DrawCanvas.jsx';
|
||||
|
||||
export default function ReaderPage() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useApp } from '../context/AppContext.js';
|
||||
import { bookOptions, formatChunkReference } from '../App.jsx';
|
||||
import { bookOptions, formatChunkReference } from '../utils/bibleUtils.jsx';
|
||||
|
||||
function SetupForm({ setup, availableTranslations, titleEdited, loadingChapter, errorMessage, hideTitle, onField, onTitleChange, onLoad }) {
|
||||
return (
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { createPortal } from 'react-dom';
|
||||
import DOMPurify from 'dompurify';
|
||||
import { useApp } from '../context/AppContext.js';
|
||||
import { STUDY_TABS, COMMENTARY_OPTIONS, NT_BOOK_NUMBER, formatChunkReference, CrossRefChip } from '../App.jsx';
|
||||
import { STUDY_TABS, COMMENTARY_OPTIONS, NT_BOOK_NUMBER, formatChunkReference, CrossRefChip } from '../utils/bibleUtils.jsx';
|
||||
import DrawCanvas from './DrawCanvas.jsx';
|
||||
|
||||
export default function StudyPage() {
|
||||
|
||||
Reference in new issue
Block a user