Questions tagged [themeprovider]
45 questions
0
votes
0 answers
I need my toggle switch in the appBar to be visible
I have created a toggle switch in the appBar but its not visible because of the code.
It changes themes between light to dark when clicked
main.dart
class MyApp extends StatelessWidget {
static const String title = "User Profile";
const…

Devendiran
- 99
- 9
0
votes
1 answer
How can I solve the "Type '{ body: string; text: string; }' is not assignable to type 'DefaultTheme" on React with typescript
I am new in programming and now I am working on my first project using React with Typescript and styled components. I am trying to add a dark mode component for my website but for 2 days I encountered a problem that I cannot overcome.
This is my…
0
votes
0 answers
MUIButton outlined style change using ThemeProvider
I wants to create 5 custom format for any type of button(variant=outlined/contained)
I found some articles to override existing or root component style like below
export const myTheme = createTheme({
components: {
MuiButton: {
…

Liam neesan
- 2,282
- 6
- 33
- 72
0
votes
1 answer
How to resolve root rendering issue with window size set in useState after server render?
After deployment to server and testing in Gatsby with gatsby clean && gatsby build && gatsby serve whenever root (https://foobar.com/) is visited anything that relies on my ThemeProvider for dimensions doesn't render correctly.
After debugging I've…

DᴀʀᴛʜVᴀᴅᴇʀ
- 7,681
- 17
- 73
- 127
0
votes
2 answers
Paper background color not changing using Material UI ThemeProvider
I am creating a react frontend using Material UI. I have created a basic Paper component and I want to change its background color and set it to the primary color set in ThemeProvider. Following is my code
import React from 'react'
import…

Tej Partap Singh
- 1
- 1
0
votes
0 answers
TypeError: Cannot read properties of undefined (reading 'up') when using withStyle HOC MUI 5
Recently migrated my code from MUI v4 to v5, Jest not able to find 'theme' in mystyle.js file, getting this error while running test cases, please find the code snippit below.
NOTE: My parent component is wrapped with themeProvider as this was…

Manav jethani
- 32
- 8
0
votes
0 answers
How do I display the value of a theme object on the front end (e.g. #141414) vs the token name (e.g. bgPrimary)?
I've styled my website using a theme.js file utilizing emotion and styled-system and want to show the value (e.g #141414) on the front end vs the token name (e.g bgPrimary).
Obviously when I use the token in practice, my website's background is the…
0
votes
2 answers
react material-ui v5 theming doesnt work with storybook
I spend a few days trying to customize the primary color and add two more colors to the palette. I was able to declare properly the new colors...but at the moment to see those new colors reflected on the button doesnt work. The button are taking the…

juanvargas
- 5
- 4
0
votes
1 answer
How to add DarkMode to Navigator in App.js
I have to add DarkMode switch to one of the Screen which applies to all the screen in React Native IOS App.
Below is the App.js where I wrap my main navigator inside ThemeProvider
import React from 'react';
import {Provider} from…

Poornima Gurudath
- 71
- 1
- 10
0
votes
1 answer
Getting access to a color in ThemeProvider React Native
I have a theme like this:
export const theme = {
red: "#CF3721",
darkGrey: "#191919",
white: "#fff",
blue: "#31A9B8",
};
and a ThemeProvider:
How can I get access f.e. to the…

some nooby questions
- 623
- 7
- 26
0
votes
2 answers
Flutter Riverpod, how avoid rebuilding whole page using consumer
Ive recently replaced Provider from my project to riverpod which is used with firebase auth to provide auth state.
On my login page, i two textformfields for email and password, and i have the sign in button inside a consumer. Ive also added a theme…

RedsVision
- 33
- 7
0
votes
1 answer
Why is ThemeProvider generating this error?
So I am a bit new to react and I am trying to set up a toggled theme for my website.
These are the instructions I followed -"https://css-tricks.com/a-dark-mode-toggle-with-react-and-themeprovider/"
Note: My app is a react + NetCore app.
Whenever I…

Sechaba Motaung
- 21
- 1
- 7
0
votes
0 answers
'ThemeProvider' is not exported from '@material-ui/core/styles'
I am trying to implement ThemeProvider but getting error
'ThemeProvider' is not exported from '@material-ui/core/styles'
Here's the code

The IT gal
- 197
- 1
- 5
- 15
0
votes
1 answer
How can I create a ThemeProvider that adds a global css file?
How would you add a global css file as a custom ThemeProvider component in React? I'm building a component library for NPM. So it would enable another React application to use the css file globally.
I've tried creating one like this:
import React…

SebastianOpperman
- 6,988
- 6
- 30
- 36
-1
votes
2 answers
Nested ThemeProvider overrides theme style definition
I need to be able to render a component and then do additional rendering using useEffects.
In the code below the component is provided with a theme and each useEffect renders components that have their own theme.
But in the final react rendering the…

gaitat
- 12,449
- 4
- 52
- 76