extendTheme's return type is any
See original GitHub issue🐛 Bug report
Provide a brief description of the bug here
It seems that at some point extendTheme
’s return type became any
.
💥 Steps to reproduce
Clear and concise reproduction steps are important for us to be able to triage your issue in a timely manner
- Attempt to extend theme
const colors = {
brand: {
100: "#ffffff",
200: "#ededed"
}
};
const extendedTheme = extendTheme({ colors });
- observe type of extendedTheme variable in editor is
any
💻 Link to reproduction
🧐 Expected behavior
Tell us what you expect to happen.
A return type that reflects the extended theme.
This is the code that was working at some point.
import { extendTheme, useTheme } from '@chakra-ui/react';
export const theme = extendTheme(overrides, baseTheme);
export type AppTheme = typeof theme;
const theme = useTheme<AppTheme>();
🌍 System information
Software | Version(s) |
---|---|
Chakra UI | >1.0.4 |
📝 Additional information
I’m not sure if something changed with the api and I just missed it. Let me know if I can help in any other way.
Thanks for all of the hard work and the great library!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Terms - ExtendThemes
Refund Policy: We offer refunds to any unsatisfied customer up to fourteen (14) days after the purchase was made. If you would like...
Read more >CSS theme variables - Customization - Material UI - MUI
extendTheme() returns a theme for CssVarsProvider . Color schemes. The major difference from the default approach is in palette customization. With the ...
Read more >Customize Theme - Chakra UI
Customizing theme tokens To extend or override a token in the default theme, import the extendTheme function and add the keys you'd like...
Read more >Customizing Theme - NativeBase
The Theme is one of the core elements of NativeBase. You can customize NativeBase's theme as per your liking. NativeBase theme is a...
Read more >Customize Theme - Chakra UI
In some scenarios, you might need to customize the theme tokens to match your ... import the extendTheme function and add the keys...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The introduction of an arbitrary base theme lead to the return type any.
Next step would be to define a generic
ChakraTheme
type and not to derive the Theme type from the default theme. I am thinking of something likeYes, can confirm. Hope it will return to the latest version as well