Does it work with React 18 Strict Mode?
See original GitHub issueIssue Description
This repo using react 18 https://github.com/DefectingCat/code-hike-test fails with:
Unhandled Runtime Error
TypeError: Cannot read properties of null (reading 'querySelector')
Call Stack
getPanelSnapshot
node_modules/@code-hike/mdx/dist/components.esm.mjs (2875:0)
eval
node_modules/@code-hike/mdx/dist/components.esm.mjs (2864:109)
basicStateReducer
node_modules/react-dom/cjs/react-dom.development.js (16376:0)
updateReducer
node_modules/react-dom/cjs/react-dom.development.js (16500:0)
updateState
node_modules/react-dom/cjs/react-dom.development.js (16836:0)
Object.useState
node_modules/react-dom/cjs/react-dom.development.js (17762:0)
Object.useState
node_modules/react/cjs/react.development.js (1617:0)
useSnapshots
node_modules/@code-hike/mdx/dist/components.esm.mjs (2849:55)
useTransition
node_modules/@code-hike/mdx/dist/components.esm.mjs (2442:41)
EditorTween
node_modules/@code-hike/mdx/dist/components.esm.mjs (2927:37)
It works after changing react 18 to 17.
Issue Analytics
- State:
- Created 10 months ago
- Reactions:1
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Strict Mode - React
StrictMode is a tool for highlighting potential problems in an application. Like Fragment , StrictMode does not render any visible UI. It activates...
Read more >Using strict mode in React 18: A guide to its new behaviors
React v18 introduced new strict mode behavior regarding unmounting and remounting. Now, each element will be unmounted and remounted with the ...
Read more >Does strict mode work differently with React 18?
In React 18, StrictMode gets an additional behavior to ensure it's compatible with reusable state. When Strict Mode is enabled, React ...
Read more >How to use React Strict Mode in React 18 - Refine Dev
React Strict Mode is a developer tool highlighting potential bugs or issues in a React application's codebase. It provides warnings to ...
Read more >React on Twitter: "If your app doesn't work after upgrading to ...
If your app doesn't work after upgrading to React 18, the first thing to check is whether it's wrapped in <StrictMode>. Strict Mode...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Confirmed, it’s CodeHike breaking React 18 Strict Mode. I’ll push the fix soon.
🚀 Issue was released in
v0.5.0
🚀