Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Dark Themes does not work with React Admin Enterprise

Open
#596 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
react, typescript
Domain
frontend

Research direction

Start in AdminGuesser.tsx and reproduce the example with React Admin Enterprise, HydraAdmin, and custom lightTheme and darkTheme props. Trace where the darkTheme value is overridden by the default API Platform theme; done means the supplied theme parameters remain effective in the application.

Written by the indexing model from the issue text.

Description

API Platform version(s) affected: @api-platform/admin 3.4.9

Description

It is not possible to configure the light and dark themes when using React Admin Enterprise, the Dark Theme parameters are lost in the process and we only get a broken standard dark theme on most parts of the application.

How to reproduce

import {HydraAdmin} from "@api-platform/admin"
import {houseDarkTheme, houseLightTheme} from "react-admin"
import {Admin} from "@react-admin/ra-enterprise"
import {SolarLayout} from "@react-admin/ra-navigation";

const GyroscopsLoader = ({ entrypoint, ...rest }: DashboardLoaderProps) => {
  return (
    <HydraAdmin
      admin={Admin}
      dataProvider={dataProvider}
      entrypoint={entrypoint}
      layout={SolarLayout}
      lightTheme={houseLightTheme}
      darkTheme={houseDarkTheme}
      defaultTheme="light"
      {{...rest}}
    >
   // Resources here
   </HydraAdmin>
  )
}

Possible Solution

In the AdminGuesser.tsx file, the AdminGuesser component does override anything we could set inside the darkTheme prop with the default APIP dark theme. It may be fixed by fixing this forced override.

Additional Context
#403

Dominant language
TypeScript
Stars
516
Forks
134
PR merge metrics
No merged PRs in 30d

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.

More from api-platform/admin

All issues in api-platform/admin

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.