github marmelab/react-admin v4.11.0
4.11.0

latest releases: v5.0.0-beta.0, v4.16.17, v4.16.16...
11 months ago
  • 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 to useForm (#8911) (slax57)
  • Fix useGetList default onSuccess throws when the query is disabled (#8941) (slax57)
  • Fix <SimpleForm> and <TabbedForm> do not sanitize the resetOptions prop (#8915) (slax57)
  • [TypeScript] Allow to provide the record type to fields and validate the source and sortBy 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
+   }
+ }

Don't miss a new react-admin release

NewReleases is sending notifications on new releases.