Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request]: The opportunity not to store theme value in LS #295

Open
chertik77 opened this issue May 24, 2024 · 4 comments
Open

[Feature request]: The opportunity not to store theme value in LS #295

chertik77 opened this issue May 24, 2024 · 4 comments
Labels

Comments

@chertik77
Copy link

chertik77 commented May 24, 2024

What feature would you like to see?

i would like to be able to disable storing key in localStorage.

My use case:

I have a select with 3 themes. And after user selects the theme i make a api call for changing user theme. So i store theme on backend by myself. And also after logout i don't want too see userTheme cause he isn't signed in.

Instead of viewing storageKey of wherever provider takes value from - view defaultTheme.

 <ThemeProvider
   attribute='class'
   storageKey={undefined}
   defaultTheme={store.getState().user.user.theme}
   themes={themes}
   enableSystem={false}>

Is there any way to disable storing keys? it would be nice to have a prop noStorage

@chertik77 chertik77 changed the title [Feature request]: The ability not to store theme value in LS [Feature request]: The opportunity not to store theme value in LS May 25, 2024
@BenjaminIsMyName
Copy link

BenjaminIsMyName commented Aug 19, 2024

That's such a basic feature. I'm shocked it's not already included in this package.
Might need to uninstall it.

@BenjaminIsMyName
Copy link

As a workaround, for now - i'm setting the theme to the default theme when page loads

image

@chertik77
Copy link
Author

As a workaround, for now - i'm setting the theme to the default theme when page loads

image

It works until the user signed in, but if I log out, and then sign in, it won't work 🥲

@Tasztalos69
Copy link

+1, this is very much needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants