fix: React 18 Strict Mode compatibility for SuperDoc initialization#7
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| export default defineConfig({ | ||
| plugins: [react()], | ||
| base: '/', | ||
| resolve: { | ||
| alias: { | ||
| 'superdoc/dist/style.css': path.resolve(__dirname, '../node_modules/superdoc/dist/style.css') | ||
| }, | ||
| dedupe: ['react', 'react-dom', 'react/jsx-runtime'] | ||
| } | ||
| }); No newline at end of file |
There was a problem hiding this comment.
Restore React dedupe in demo Vite config
Removing the resolve.dedupe entry here means the demo now loads separate React copies: the linked library pulls React 19 from the repo root while the demo itself installs React 18 (see demo/pnpm-lock.yaml). Without Vite deduping, the library’s hooks run against a different React instance than the app, which will throw the “Invalid hook call” runtime error as soon as the demo renders the linked component. Please reintroduce deduping for react/react-dom in this config so both sides share one React build.
Useful? React with 👍 / 👎.
# [1.4.0](v1.3.1...v1.4.0) (2025-12-11) ### Bug Fixes * add 'react/jsx-runtime' to external dependencies in Vite config ([f05380f](f05380f)) * disable comments module + sd update ([#8](#8)) ([b9ac704](b9ac704)) * React 18 Strict Mode compatibility for SuperDoc initialization ([#7](#7)) ([488eed8](488eed8)) * restore React dedupe to prevent duplicate instance errors ([3fc8f99](3fc8f99)) * update GitHub Actions workflow to correctly set environment variables and clean up build artifacts ([a1eba5b](a1eba5b)) ### Features * background color css ([#6](#6)) ([73c2862](73c2862))
No description provided.