Package Exports
- shd-react-day-night-switch
- shd-react-day-night-switch/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (shd-react-day-night-switch) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
React component - Day night switch from tik-tok
"peerDependencies": {
"react": "*",
"react-dom": "*",
"styled-components": "*"
},
How use
import React, { useState } from 'react'
import DayNightSwitch from "@shd/react-day-night-switch";
const App = () => {
const [isDarkMode, setIsDarkMode] = useState(false)
return (
<DayNightSwitch
onChange={() => setIsDarkMode(!isDarkMode)}
checked={isDarkMode}
/>
)
}