File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed
Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -7,8 +7,6 @@ export interface CoreProps {
77 t ?: string ;
88 /** The nonce value for your Content Security Policy. */
99 nonce ?: string ;
10- /** dp -> Do Not Persist. Set this prop when you do not want to persist the mode. e.g., when using Tailwind, but you prefer SSG */
11- dp ?: boolean ;
1210}
1311
1412/** Modify transition globally to avoid patched transitions */
@@ -38,8 +36,8 @@ const modifyTransition = (themeTransition = "none", nonce = "") => {
3836 *
3937 * @source - Source code
4038 */
41- export const Core = ( { t, nonce, dp } : CoreProps ) => {
42- const [ { m : mode , s : systemMode } , setThemeState ] = useStore ( dp ) ;
39+ export const Core = ( { t, nonce } : CoreProps ) => {
40+ const [ { m : mode , s : systemMode } , setThemeState ] = useStore ( ) ;
4341 const resolvedMode = mode === SYSTEM ? systemMode : mode ; // resolvedMode is the actual mode that will be used
4442
4543 useEffect ( ( ) => {
Original file line number Diff line number Diff line change @@ -9,13 +9,13 @@ export interface Store {
99}
1010
1111/** local abstaction of RGS to avoid multiple imports */
12- export const useStore = ( /** Do not persist */ dp ?: boolean ) =>
12+ export const useStore = ( ) =>
1313 useRGS < Store > ( "ndm" , ( ) =>
1414 typeof localStorage === "undefined"
1515 ? /* v8 ignore next */
1616 { m : SYSTEM , s : DARK as ResolvedScheme }
1717 : {
18- m : ( dp ? SYSTEM : localStorage . getItem ( COOKIE_KEY ) ?? SYSTEM ) as ColorSchemePreference ,
18+ m : ( localStorage . getItem ( COOKIE_KEY ) ?? SYSTEM ) as ColorSchemePreference ,
1919 s : ( matchMedia ( MEDIA ) . matches ? DARK : LIGHT ) as ResolvedScheme ,
2020 } ,
2121 ) ;
You can’t perform that action at this time.
0 commit comments