question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

  1. Go to node_modules/@chakra-ui/react/dist/types/extend-theme.d.ts
  2. 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:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
with-heartcommented, Apr 29, 2021

Upon further investigation, the problem is that extendTheme relies on pipe, which is not generic and returns any. Need to determine how to properly type the pipe function in order to construct the correct types, but for the time being, we should guarantee that extendTheme at least returns the default theme type.

3reactions
DrGorcommented, Apr 27, 2021

@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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found