mui / mui/material-ui

useTheme() hook is not returning palette colors

Open
#32,806 19 comments 3 reactions 1 assignee View on GitHub

@siriwatknp is already working on this.

Since May 23, 2022.

scope: system
Dominant language
JavaScript
Stars
99.1k
Forks
32.5k
Avg merge
2d 17h
Merged PRs (30d)
106

Description

Duplicates
  • I have searched the existing issues
Latest version
  • I have tested the latest version
Current behavior 😯

`const theme = useTheme();

console.log(theme.palette); // => {mode: 'light'}`

Expected behavior 🤔

`const theme = useTheme();

console.log(theme.palette); // => {mode: 'light', primary: { ... }, secondary: { ... }, ... }`

Steps to reproduce 🕹

No response

Context 🔦

No response

Your environment 🌎
@emotion/react: ^11.9.0 => 11.9.0
@emotion/styled: ^11.8.1 => 11.8.1
@mui/base:  5.0.0-alpha.81
@mui/icons-material:  5.6.2
@mui/lab: 5.0.0-alpha.74 => 5.0.0-alpha.74
@mui/material: ^5.8.0 => 5.8.0
@mui/private-theming:  5.6.2
@mui/styled-engine:  5.6.1
@mui/styles:  5.6.2
@mui/system:  5.6.4
@mui/types:  7.1.3
@mui/utils:  5.6.1
@types/react:  18.0.9
react: ^18.1.0 => 18.1.0
react-dom: ^18.1.0 => 18.1.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.