- Add
<WithListContext>
component (#8917) (fzaninotto) - Expose
setNotifications
callback in<NotificationContext>
to allow for a custom notifications center (#8914) (smeng9) - Add
purifyOptions
prop to<RichTextField>
(#8905) (slax57) - Add
queryOptions
prop to<ReferenceField>
(#8895) (Wi)XSL - Add ability to default to dark mode when users prefer it (#8874) (fzaninotto) (minor breaking change, see below)
- Simplify form reset on record change, and forward supported props from
useAugmentedForm
touseForm
(#8911) (slax57) - Fix
useGetList
defaultonSuccess
throws when the query is disabled (#8941) (slax57) - Fix
<SimpleForm>
and<TabbedForm>
do not sanitize theresetOptions
prop (#8915) (slax57) - [TypeScript] Allow to provide the record type to fields and validate the
source
andsortBy
prop (#8863) (djhi) - [TypeScript] Fix types that should accept a react-admin record (#8862) (djhi)
Minor breaking change: If you're using react-admin's useTheme
and TypeScript, upgrading to 4.11 will break TS compilation. this is because the return type of useTheme
is now a theme object or a theme name. So if you inspected the theme (e.g. to see if it's a light or dark theme), you must check that it's an RaThemeOptions
first.
const theme = useTheme();
- if (theme.palette.mode === "dark") {
- // do stuff for dark theme
- } else {
- // do stuff for light theme
- }
+ if ((typeof theme === "string") {
+ if theme === "dark") {
+ // do stuff for dark theme
+ } else {
+ // do stuff for light theme
+ }
+ } else {
+ if (theme.palette.mode === "dark") {
+ // do stuff for dark theme
+ } else {
+ // do stuff for light theme
+ }
+ }