question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Does it work with React 18 Strict Mode?

See original GitHub issue

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:closed
  • Created a year ago
  • Reactions:1
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
pombercommented, May 6, 2022

Confirmed, it’s CodeHike breaking React 18 Strict Mode. I’ll push the fix soon.

1reaction
github-actions[bot]commented, May 10, 2022

🚀 Issue was released in v0.5.0 🚀

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found