The return type of `extendTheme` is `any`
See original GitHub issue🐛 Bug report
The return type of extendTheme
is now any
. Possible regression of https://github.com/chakra-ui/chakra-ui/issues/3101
💥 Steps to reproduce
- Go to
node_modules/@chakra-ui/react/dist/types/extend-theme.d.ts
- Check return type of
extendTheme
💻 Link to reproduction
https://codesandbox.io/s/crazy-mcclintock-s7pji?file=/src/App.tsx
🧐 Expected behavior
A return type that reflects the extended theme.
🧭 Possible Solution
🌍 System information
Software | Version(s) |
---|---|
Chakra UI | 1.6.0 |
Browser | any |
Operating System | any |
📝 Additional information
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:7 (3 by maintainers)
Top Results From Across the Web
extendTheme's return type is any · Issue #3101 · chakra-ui ...
A return type that reflects the extended theme. This is the code that was working at some point. import { extendTheme, useTheme } ......
Read more >How to extend Material-UI Theme with Typescript?
We would find that Theme and ThemeOptions play a different role. Theme: return type; ThemeOptions: params type.
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 >Text and Layer Styles - Chakra UI
Once created, pass the layerStyle prop to any component and chakra will resolve the styles accordingly. ... import { extendTheme } from '@chakra-ui/react'....
Read more >Customizing Components - NativeBase
Using NativeBase's extendTheme function, we can customise components. Components can be customised by overriding baseStyle/defaultProps or adding a new ...
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
Upon further investigation, the problem is that
extendTheme
relies onpipe
, which is not generic and returnsany
. Need to determine how to properly type thepipe
function in order to construct the correct types, but for the time being, we should guarantee thatextendTheme
at least returns the default theme type.@with-heart @segunadebayo
You’re not using the latest version of
chakra-ui/react
in CodeSandbox.Try this link: https://codesandbox.io/s/crazy-mcclintock-s7pji?file=/src/App.tsx
Very easy to replicate. Can someone reopen this bug?