Created
March 19, 2022 13:27
-
-
Save AhmetEnesKCC/b07575627f237178348c31bb5b6f9beb to your computer and use it in GitHub Desktop.
Use in html
This file contains 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
const setThemeRelatedToSystem = () => { | |
// ... rest of the function's code | |
} | |
// Plain JS | |
document.addEventListener("DOMContentLoad", () => { | |
setThemeRelatedToSystem(); | |
}) | |
// Jquery | |
$(() => { | |
setThemeRelatedToSystem(); | |
}) | |
// React JS | |
/* app.js or index.js */ | |
useEffect(() => { | |
setThemeRelatedToSystem(); | |
}, []) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment