dark-mode-toggle with React
See original GitHub issueHi,
A DOMException error occurs when <dark-mode-toggle>
is used in React apps.
Failed to construct ‘CustomElement’: The result must not have attributes
I think it occurs when document.createElement has been called.
The error would be solved if the DOM related tasks move from constructor
to connectedCallback
, but I am not sure this is an appropriate change for dark-mode-toggle.
Issue Analytics
- State:
- Created a year ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
react-toggle-dark-mode - npm
Animated dark mode toggle as seen in blogs! ... Start using react-toggle-dark-mode in your project by running `npm i react-toggle-dark-mode` ...
Read more >A Dark Mode Toggle with React and ThemeProvider
In this tutorial, we're going to build a toggle that allows users to switch between light and dark modes, using a <ThemeProvider wrapper...
Read more >Toggle Dark Mode in React - DEV Community
First, I set up the basic JSX, the local state, and a variable to hold the theme we get from localStorage: import React,...
Read more >Dark Mode in React. How do you make a dark theme in react…
Step 1: Create a React app (skip if it's already done) · Step 2: Create the theme (dark/light) · Step 3: Provide and...
Read more >react-dark-mode-toggle examples - CodeSandbox
Learn how to use react-dark-mode-toggle by viewing and forking react-dark-mode-toggle example apps on CodeSandbox.
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
The site has no error. Thanks a lot for your work!
Version
0.11.0
fixes this. Thanks for reporting again!