This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import useDarkMode from "use-dark-mode"; // Don't forget to import the NPM package use-dark-mode | |
function darkModeToggleButton() { | |
const darkMode = useDarkMode(false); | |
return (<button onClick={darkMode.toggle}>Toggle Day / Night</button>); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from "react"; | |
import ReactDOM from "react-dom"; | |
import useDarkMode from "use-dark-mode"; // Don't forget to import the NPM package use-dark-mode | |
import "./styles.scss"; | |
function App() { | |
const darkMode = useDarkMode(false); | |
const getDayNightAsString = () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from "react"; | |
import ReactDOM from "react-dom"; | |
import "./styles.css"; | |
function App() { | |
const [toggleState, setToggleState] = useState({ isTrue: false }); | |
const [counterState, setCounterState] = useState({ counter: 0 }); | |
const toggleTrueFalse = () => { |