From 66939a9105fbbc0c05d462bf2d0bd6062a5ffcb2 Mon Sep 17 00:00:00 2001
From: djhi <1122076+djhi@users.noreply.github.com>
Date: Thu, 24 Sep 2020 17:42:52 +0200
Subject: [PATCH 1/7] More TS fixes

---
 .../input/useReferenceArrayInputController.ts |  4 +-
 .../src/controller/useShowController.ts       |  2 +-
 packages/ra-core/src/types.ts                 |  2 +
 packages/ra-ui-materialui/src/button/index.ts |  4 +-
 .../src/detail/{Show.js => Show.tsx}          | 15 ++++--
 .../{ShowActions.js => ShowActions.tsx}       | 20 ++++++-
 ...mpleShowLayout.js => SimpleShowLayout.tsx} | 18 +++++--
 ...bbedShowLayout.js => TabbedShowLayout.tsx} | 27 ++++++++--
 ...LayoutTabs.js => TabbedShowLayoutTabs.tsx} |  4 +-
 .../src/detail/{index.js => index.ts}         |  0
 .../ra-ui-materialui/src/form/SimpleForm.tsx  |  9 +++-
 .../ra-ui-materialui/src/form/TabbedForm.tsx  |  2 +
 packages/ra-ui-materialui/src/form/index.tsx  |  6 +--
 .../ra-ui-materialui/src/input/Labeled.tsx    | 12 ++---
 ...eArrayInput.js => ReferenceArrayInput.tsx} | 53 +++++++++++++++++--
 .../src/input/SelectArrayInput.tsx            | 15 ++++--
 .../ra-ui-materialui/src/layout/Sidebar.tsx   | 18 +++++--
 packages/ra-ui-materialui/src/layout/index.ts |  6 ++-
 .../ra-ui-materialui/src/list/SimpleList.tsx  |  2 +-
 .../src/list/datagrid/ExpandRowButton.tsx     | 12 ++---
 20 files changed, 181 insertions(+), 50 deletions(-)
 rename packages/ra-ui-materialui/src/detail/{Show.js => Show.tsx} (93%)
 rename packages/ra-ui-materialui/src/detail/{ShowActions.js => ShowActions.tsx} (82%)
 rename packages/ra-ui-materialui/src/detail/{SimpleShowLayout.js => SimpleShowLayout.tsx} (88%)
 rename packages/ra-ui-materialui/src/detail/{TabbedShowLayout.js => TabbedShowLayout.tsx} (87%)
 rename packages/ra-ui-materialui/src/detail/{TabbedShowLayoutTabs.js => TabbedShowLayoutTabs.tsx} (91%)
 rename packages/ra-ui-materialui/src/detail/{index.js => index.ts} (100%)
 rename packages/ra-ui-materialui/src/input/{ReferenceArrayInput.js => ReferenceArrayInput.tsx} (83%)

diff --git a/packages/ra-core/src/controller/input/useReferenceArrayInputController.ts b/packages/ra-core/src/controller/input/useReferenceArrayInputController.ts
index 09379a9b2cb..dd0ffdc1236 100644
--- a/packages/ra-core/src/controller/input/useReferenceArrayInputController.ts
+++ b/packages/ra-core/src/controller/input/useReferenceArrayInputController.ts
@@ -216,7 +216,7 @@ interface ReferenceArrayInputProps {
 }
 
 interface Option {
-    basePath: string;
+    basePath?: string;
     filter?: any;
     filterToQuery?: (filter: any) => any;
     input: FieldInputProps<any, HTMLElement>;
@@ -224,7 +224,7 @@ interface Option {
     perPage?: number;
     record?: Record;
     reference: string;
-    resource: string;
+    resource?: string;
     sort?: SortPayload;
     source: string;
 }
diff --git a/packages/ra-core/src/controller/useShowController.ts b/packages/ra-core/src/controller/useShowController.ts
index 93312ca7b0b..aaaf359d7fa 100644
--- a/packages/ra-core/src/controller/useShowController.ts
+++ b/packages/ra-core/src/controller/useShowController.ts
@@ -15,7 +15,7 @@ export interface ShowProps {
     hasShow?: boolean;
     hasList?: boolean;
     id: Identifier;
-    resource: string;
+    resource?: string;
     [key: string]: any;
 }
 
diff --git a/packages/ra-core/src/types.ts b/packages/ra-core/src/types.ts
index 16e7dc520bb..465046995ff 100644
--- a/packages/ra-core/src/types.ts
+++ b/packages/ra-core/src/types.ts
@@ -387,12 +387,14 @@ export type LoginComponent = ComponentType<LoginComponentProps>;
 export type DashboardComponent = ComponentType<WithPermissionsChildrenParams>;
 
 export interface LayoutProps {
+    appBar?: ComponentType;
     dashboard?: DashboardComponent;
     logout?: ReactNode;
     menu?: ComponentType<{
         logout?: ReactNode;
         hasDashboard?: boolean;
     }>;
+    sideBar?: ComponentType;
     theme?: ThemeOptions;
     title?: TitleComponent;
 }
diff --git a/packages/ra-ui-materialui/src/button/index.ts b/packages/ra-ui-materialui/src/button/index.ts
index 7dc42820d83..a489b8efa80 100644
--- a/packages/ra-ui-materialui/src/button/index.ts
+++ b/packages/ra-ui-materialui/src/button/index.ts
@@ -2,7 +2,7 @@ import BulkDeleteButton from './BulkDeleteButton';
 import BulkDeleteWithConfirmButton from './BulkDeleteWithConfirmButton';
 import BulkDeleteWithUndoButton from './BulkDeleteWithUndoButton';
 import BulkExportButton from './BulkExportButton';
-import Button from './Button';
+import Button, { ButtonProps } from './Button';
 import CloneButton from './CloneButton';
 import CreateButton from './CreateButton';
 import DeleteButton from './DeleteButton';
@@ -17,6 +17,8 @@ import SortButton from './SortButton';
 import RefreshButton from './RefreshButton';
 import RefreshIconButton from './RefreshIconButton';
 
+export type { ButtonProps };
+
 export {
     BulkDeleteButton,
     BulkDeleteWithConfirmButton,
diff --git a/packages/ra-ui-materialui/src/detail/Show.js b/packages/ra-ui-materialui/src/detail/Show.tsx
similarity index 93%
rename from packages/ra-ui-materialui/src/detail/Show.js
rename to packages/ra-ui-materialui/src/detail/Show.tsx
index 2729ea426fb..e5e7cf0cb46 100644
--- a/packages/ra-ui-materialui/src/detail/Show.js
+++ b/packages/ra-ui-materialui/src/detail/Show.tsx
@@ -4,10 +4,11 @@ import PropTypes from 'prop-types';
 import Card from '@material-ui/core/Card';
 import { makeStyles } from '@material-ui/core/styles';
 import classnames from 'classnames';
-import { useShowController } from 'ra-core';
+import { ShowControllerProps, useShowController } from 'ra-core';
 
 import DefaultActions from './ShowActions';
 import TitleForRecord from '../layout/TitleForRecord';
+import { ShowProps } from '../types';
 
 /**
  * Page component for the Show view
@@ -52,7 +53,9 @@ import TitleForRecord from '../layout/TitleForRecord';
  * );
  * export default App;
  */
-const Show = props => <ShowView {...props} {...useShowController(props)} />;
+const Show = (props: ShowProps) => (
+    <ShowView {...props} {...useShowController(props)} />
+);
 
 Show.propTypes = {
     actions: PropTypes.element,
@@ -69,7 +72,11 @@ Show.propTypes = {
     title: PropTypes.node,
 };
 
-export const ShowView = props => {
+interface ShowViewProps
+    extends ShowProps,
+        Omit<ShowControllerProps, 'resource'> {}
+
+export const ShowView = (props: ShowViewProps) => {
     const {
         actions,
         aside,
@@ -207,6 +214,6 @@ const sanitizeRestProps = ({
     permissions,
     translate,
     ...rest
-}) => rest;
+}: any) => rest;
 
 export default Show;
diff --git a/packages/ra-ui-materialui/src/detail/ShowActions.js b/packages/ra-ui-materialui/src/detail/ShowActions.tsx
similarity index 82%
rename from packages/ra-ui-materialui/src/detail/ShowActions.js
rename to packages/ra-ui-materialui/src/detail/ShowActions.tsx
index 960f19f69c2..291ed17ae4c 100644
--- a/packages/ra-ui-materialui/src/detail/ShowActions.js
+++ b/packages/ra-ui-materialui/src/detail/ShowActions.tsx
@@ -1,5 +1,6 @@
 import * as React from 'react';
 import PropTypes from 'prop-types';
+import { Record } from 'ra-core';
 
 import { EditButton } from '../button';
 import TopToolbar from '../layout/TopToolbar';
@@ -12,7 +13,7 @@ const sanitizeRestProps = ({
     hasList,
     resource,
     ...rest
-}) => rest;
+}: any) => rest;
 
 /**
  * Action Toolbar for the Show view
@@ -39,12 +40,27 @@ const sanitizeRestProps = ({
  *         </Show>
  *     );
  */
-const ShowActions = ({ basePath, className, data, hasEdit, ...rest }) => (
+const ShowActions = ({
+    basePath,
+    className,
+    data,
+    hasEdit,
+    ...rest
+}: ShowActionsProps) => (
     <TopToolbar className={className} {...sanitizeRestProps(rest)}>
         {hasEdit && <EditButton basePath={basePath} record={data} />}
     </TopToolbar>
 );
 
+export interface ShowActionsProps {
+    basePath?: string;
+    className?: string;
+    data?: Record;
+    hasEdit?: boolean;
+    hasList?: boolean;
+    resource?: string;
+}
+
 ShowActions.propTypes = {
     basePath: PropTypes.string,
     className: PropTypes.string,
diff --git a/packages/ra-ui-materialui/src/detail/SimpleShowLayout.js b/packages/ra-ui-materialui/src/detail/SimpleShowLayout.tsx
similarity index 88%
rename from packages/ra-ui-materialui/src/detail/SimpleShowLayout.js
rename to packages/ra-ui-materialui/src/detail/SimpleShowLayout.tsx
index 8c73d9ef6a0..5b48b7c78a6 100644
--- a/packages/ra-ui-materialui/src/detail/SimpleShowLayout.js
+++ b/packages/ra-ui-materialui/src/detail/SimpleShowLayout.tsx
@@ -1,7 +1,8 @@
 import * as React from 'react';
-import { Children, isValidElement, cloneElement } from 'react';
+import { Children, isValidElement, cloneElement, ReactNode } from 'react';
 import PropTypes from 'prop-types';
 import classnames from 'classnames';
+import { Record } from 'ra-core';
 
 import CardContentInner from '../layout/CardContentInner';
 import Labeled from '../input/Labeled';
@@ -16,7 +17,7 @@ const sanitizeRestProps = ({
     initialValues,
     translate,
     ...rest
-}) => rest;
+}: any) => rest;
 
 /**
  * Simple Layout for a Show view, showing fields in one column.
@@ -58,14 +59,14 @@ const SimpleShowLayout = ({
     resource,
     version,
     ...rest
-}) => (
+}: SimpleShowLayoutProps) => (
     <CardContentInner
         className={className}
         key={version}
         {...sanitizeRestProps(rest)}
     >
         {Children.map(children, field =>
-            field && isValidElement(field) ? (
+            field && isValidElement<any>(field) ? (
                 <div
                     key={field.props.source}
                     className={classnames(
@@ -99,6 +100,15 @@ const SimpleShowLayout = ({
     </CardContentInner>
 );
 
+export interface SimpleShowLayoutProps {
+    basePath?: string;
+    className?: string;
+    children: ReactNode;
+    record?: Record;
+    resource?: string;
+    version?: number;
+}
+
 SimpleShowLayout.propTypes = {
     basePath: PropTypes.string,
     className: PropTypes.string,
diff --git a/packages/ra-ui-materialui/src/detail/TabbedShowLayout.js b/packages/ra-ui-materialui/src/detail/TabbedShowLayout.tsx
similarity index 87%
rename from packages/ra-ui-materialui/src/detail/TabbedShowLayout.js
rename to packages/ra-ui-materialui/src/detail/TabbedShowLayout.tsx
index 0566c0fbd12..cfb87ce4ef2 100644
--- a/packages/ra-ui-materialui/src/detail/TabbedShowLayout.js
+++ b/packages/ra-ui-materialui/src/detail/TabbedShowLayout.tsx
@@ -1,13 +1,20 @@
 import * as React from 'react';
-import { Children, cloneElement, isValidElement } from 'react';
+import {
+    Children,
+    cloneElement,
+    isValidElement,
+    ReactElement,
+    ReactNode,
+} from 'react';
 import PropTypes from 'prop-types';
 import Divider from '@material-ui/core/Divider';
 import { Route } from 'react-router-dom';
 import { makeStyles } from '@material-ui/core/styles';
 import { useRouteMatch } from 'react-router-dom';
-import { escapePath } from 'ra-core';
+import { escapePath, Record } from 'ra-core';
 
 import TabbedShowLayoutTabs, { getTabFullPath } from './TabbedShowLayoutTabs';
+import { ClassesOverride } from '../types';
 
 const sanitizeRestProps = ({
     children,
@@ -21,7 +28,7 @@ const sanitizeRestProps = ({
     translate,
     tabs,
     ...rest
-}) => rest;
+}: any) => rest;
 
 const useStyles = makeStyles(
     theme => ({
@@ -73,7 +80,7 @@ const useStyles = makeStyles(
  *     );
  *     export default App;
  */
-const TabbedShowLayout = props => {
+const TabbedShowLayout = (props: TabbedShowLayoutProps) => {
     const {
         basePath,
         children,
@@ -119,6 +126,18 @@ const TabbedShowLayout = props => {
     );
 };
 
+export interface TabbedShowLayoutProps {
+    basePath?: string;
+    className?: string;
+    classes?: ClassesOverride<typeof useStyles>;
+    children: ReactNode;
+    record?: Record;
+    resource?: string;
+    tabs: ReactElement;
+    value?: any;
+    version?: number;
+}
+
 TabbedShowLayout.propTypes = {
     children: PropTypes.node,
     className: PropTypes.string,
diff --git a/packages/ra-ui-materialui/src/detail/TabbedShowLayoutTabs.js b/packages/ra-ui-materialui/src/detail/TabbedShowLayoutTabs.tsx
similarity index 91%
rename from packages/ra-ui-materialui/src/detail/TabbedShowLayoutTabs.js
rename to packages/ra-ui-materialui/src/detail/TabbedShowLayoutTabs.tsx
index 610427e3e98..4b2ef9c4a15 100644
--- a/packages/ra-ui-materialui/src/detail/TabbedShowLayoutTabs.js
+++ b/packages/ra-ui-materialui/src/detail/TabbedShowLayoutTabs.tsx
@@ -1,5 +1,5 @@
 import * as React from 'react';
-import { Children, cloneElement, isValidElement } from 'react';
+import { Children, cloneElement, FC, isValidElement } from 'react';
 import PropTypes from 'prop-types';
 import Tabs from '@material-ui/core/Tabs';
 import { useLocation, useRouteMatch } from 'react-router-dom';
@@ -9,7 +9,7 @@ export const getTabFullPath = (tab, index, baseUrl) =>
         tab.props.path ? `/${tab.props.path}` : index > 0 ? `/${index}` : ''
     }`;
 
-const TabbedShowLayoutTabs = ({ children, ...rest }) => {
+const TabbedShowLayoutTabs: FC = ({ children, ...rest }) => {
     const location = useLocation();
     const match = useRouteMatch();
 
diff --git a/packages/ra-ui-materialui/src/detail/index.js b/packages/ra-ui-materialui/src/detail/index.ts
similarity index 100%
rename from packages/ra-ui-materialui/src/detail/index.js
rename to packages/ra-ui-materialui/src/detail/index.ts
diff --git a/packages/ra-ui-materialui/src/form/SimpleForm.tsx b/packages/ra-ui-materialui/src/form/SimpleForm.tsx
index 061d3f92a06..39b985ca4d2 100644
--- a/packages/ra-ui-materialui/src/form/SimpleForm.tsx
+++ b/packages/ra-ui-materialui/src/form/SimpleForm.tsx
@@ -1,5 +1,11 @@
 import * as React from 'react';
-import { Children, FC, ReactElement, HtmlHTMLAttributes } from 'react';
+import {
+    Children,
+    FC,
+    ReactElement,
+    ReactNode,
+    HtmlHTMLAttributes,
+} from 'react';
 import PropTypes from 'prop-types';
 import classnames from 'classnames';
 import {
@@ -83,6 +89,7 @@ export interface SimpleFormProps
             'defaultValue' | 'onSubmit' | 'children'
         > {
     basePath?: string;
+    children: ReactNode;
     className?: string;
     initialValues?: any;
     margin?: 'none' | 'normal' | 'dense';
diff --git a/packages/ra-ui-materialui/src/form/TabbedForm.tsx b/packages/ra-ui-materialui/src/form/TabbedForm.tsx
index 945e3dfcf62..1559ac73288 100644
--- a/packages/ra-ui-materialui/src/form/TabbedForm.tsx
+++ b/packages/ra-ui-materialui/src/form/TabbedForm.tsx
@@ -4,6 +4,7 @@ import {
     isValidElement,
     FC,
     ReactElement,
+    ReactNode,
     HtmlHTMLAttributes,
 } from 'react';
 import PropTypes from 'prop-types';
@@ -124,6 +125,7 @@ export interface TabbedFormProps
             'defaultValue' | 'onSubmit' | 'children'
         > {
     basePath?: string;
+    children: ReactNode;
     className?: string;
     initialValues?: any;
     margin?: 'none' | 'normal' | 'dense';
diff --git a/packages/ra-ui-materialui/src/form/index.tsx b/packages/ra-ui-materialui/src/form/index.tsx
index 8fc6bc19c28..f47440d211c 100644
--- a/packages/ra-ui-materialui/src/form/index.tsx
+++ b/packages/ra-ui-materialui/src/form/index.tsx
@@ -1,13 +1,13 @@
 import FormInput from './FormInput';
 import FormTab from './FormTab';
-import SimpleForm from './SimpleForm';
+import SimpleForm, { SimpleFormProps } from './SimpleForm';
 import SimpleFormIterator from './SimpleFormIterator';
-import TabbedForm from './TabbedForm';
+import TabbedForm, { TabbedFormProps } from './TabbedForm';
 import TabbedFormTabs from './TabbedFormTabs';
 import Toolbar, { ToolbarProps } from './Toolbar';
 import getFormInitialValues from './getFormInitialValues';
 
-export type { ToolbarProps };
+export type { SimpleFormProps, TabbedFormProps, ToolbarProps };
 
 export {
     FormInput,
diff --git a/packages/ra-ui-materialui/src/input/Labeled.tsx b/packages/ra-ui-materialui/src/input/Labeled.tsx
index 1d18c84aa74..d2b6c968a66 100644
--- a/packages/ra-ui-materialui/src/input/Labeled.tsx
+++ b/packages/ra-ui-materialui/src/input/Labeled.tsx
@@ -32,13 +32,13 @@ export interface LabeledProps {
     className?: string;
     classes?: object;
     fullWidth?: boolean;
-    id: string;
-    input: any;
-    isRequired: boolean;
+    id?: string;
+    input?: any;
+    isRequired?: boolean;
     label?: string | ReactElement;
-    meta: any;
-    resource: string;
-    source: string;
+    meta?: any;
+    resource?: string;
+    source?: string;
     [key: string]: any;
 }
 /**
diff --git a/packages/ra-ui-materialui/src/input/ReferenceArrayInput.js b/packages/ra-ui-materialui/src/input/ReferenceArrayInput.tsx
similarity index 83%
rename from packages/ra-ui-materialui/src/input/ReferenceArrayInput.js
rename to packages/ra-ui-materialui/src/input/ReferenceArrayInput.tsx
index f6e2c9b691e..a138ea23966 100644
--- a/packages/ra-ui-materialui/src/input/ReferenceArrayInput.js
+++ b/packages/ra-ui-materialui/src/input/ReferenceArrayInput.tsx
@@ -1,15 +1,33 @@
 import * as React from 'react';
+import { FC, ReactElement } from 'react';
 import PropTypes from 'prop-types';
 import {
+    InputProps,
     useReferenceArrayInputController,
     useInput,
     useTranslate,
+    SortPayload,
+    PaginationPayload,
+    Translate,
 } from 'ra-core';
 
 import sanitizeInputProps from './sanitizeRestProps';
 import LinearProgress from '../layout/LinearProgress';
-import Labeled from '../input/Labeled';
+import Labeled from './Labeled';
 import ReferenceError from './ReferenceError';
+import { FieldInputProps, FieldMetaState } from 'react-final-form';
+
+export interface ReferenceArrayInputProps extends InputProps {
+    allowEmpty?: boolean;
+    basePath?: string;
+    children: ReactElement;
+    classes?: any;
+    className?: string;
+    label?: string;
+    reference: string;
+    resource?: string;
+    [key: string]: any;
+}
 
 /**
  * An Input component for fields containing a list of references to another resource.
@@ -89,7 +107,7 @@ import ReferenceError from './ReferenceError';
  *     <SelectArrayInput optionText="name" />
  * </ReferenceArrayInput>
  */
-const ReferenceArrayInput = ({
+const ReferenceArrayInput: FC<ReferenceArrayInputProps> = ({
     children,
     id: idOverride,
     onBlur,
@@ -171,7 +189,34 @@ const sanitizeRestProps = ({
     perPage,
     referenceSource,
     ...rest
-}) => sanitizeInputProps(rest);
+}: any) => sanitizeInputProps(rest);
+
+export interface ReferenceArrayInputViewProps {
+    allowEmpty?: boolean;
+    basePath?: string;
+    children: ReactElement;
+    choices: any[];
+    classes?: object;
+    className?: string;
+    error?: string;
+    helperText?: string | boolean;
+    id: string;
+    input: FieldInputProps<any, HTMLElement>;
+    isRequired: boolean;
+    label?: string;
+    loading: boolean;
+    meta: FieldMetaState<any>;
+    onChange: any;
+    options?: any;
+    reference: string;
+    resource?: string;
+    setFilter: (v: string) => void;
+    setPagination: (pagination: PaginationPayload) => void;
+    setSort: (sort: SortPayload, order?: string) => void;
+    source: string;
+    translate: Translate;
+    warning?: string;
+}
 
 export const ReferenceArrayInputView = ({
     allowEmpty,
@@ -195,7 +240,7 @@ export const ReferenceArrayInputView = ({
     translate,
     warning,
     ...rest
-}) => {
+}: ReferenceArrayInputViewProps) => {
     const translatedLabel = translate(
         label || `resources.${resource}.fields.${source}`,
         { _: label }
diff --git a/packages/ra-ui-materialui/src/input/SelectArrayInput.tsx b/packages/ra-ui-materialui/src/input/SelectArrayInput.tsx
index eec311a2d95..b59967c90d7 100644
--- a/packages/ra-ui-materialui/src/input/SelectArrayInput.tsx
+++ b/packages/ra-ui-materialui/src/input/SelectArrayInput.tsx
@@ -140,9 +140,7 @@ const useStyles = makeStyles(
  *    { id: 'photography', name: 'myroot.tags.photography' },
  * ];
  */
-const SelectArrayInput: FunctionComponent<
-    ChoicesProps & InputProps<SelectProps> & FormControlProps
-> = props => {
+const SelectArrayInput: FunctionComponent<SelectArrayInputProps> = props => {
     const {
         choices = [],
         classes: classesOverride,
@@ -271,6 +269,17 @@ const SelectArrayInput: FunctionComponent<
     );
 };
 
+interface SelectArrayInputProps
+    extends Omit<ChoicesProps, 'choices'>,
+        Omit<InputProps<SelectProps>, 'source'>,
+        Omit<
+            FormControlProps,
+            'defaultValue' | 'onBlur' | 'onChange' | 'onFocus'
+        > {
+    choices?: object[];
+    source?: string;
+}
+
 SelectArrayInput.propTypes = {
     choices: PropTypes.arrayOf(PropTypes.object),
     classes: PropTypes.object,
diff --git a/packages/ra-ui-materialui/src/layout/Sidebar.tsx b/packages/ra-ui-materialui/src/layout/Sidebar.tsx
index 3f733f0284d..b896e5b0237 100644
--- a/packages/ra-ui-materialui/src/layout/Sidebar.tsx
+++ b/packages/ra-ui-materialui/src/layout/Sidebar.tsx
@@ -1,11 +1,12 @@
 import * as React from 'react';
-import { Children, cloneElement } from 'react';
+import { Children, cloneElement, ReactElement } from 'react';
 import PropTypes from 'prop-types';
 import { useDispatch, useSelector } from 'react-redux';
-import { Drawer, useMediaQuery, Theme } from '@material-ui/core';
+import { Drawer, DrawerProps, useMediaQuery, Theme } from '@material-ui/core';
 import { makeStyles } from '@material-ui/core/styles';
 import lodashGet from 'lodash/get';
 import { setSidebarVisibility, ReduxState, useLocale } from 'ra-core';
+import { ClassesOverride } from '../types';
 
 export const DRAWER_WIDTH = 240;
 export const CLOSED_DRAWER_WIDTH = 55;
@@ -57,7 +58,14 @@ const useStyles = makeStyles(
     { name: 'RaSidebar' }
 );
 
-const Sidebar = props => {
+export interface SidebarProps extends DrawerProps {
+    children: ReactElement;
+    closedSize?: number;
+    classes: ClassesOverride<typeof useStyles>;
+    size?: number;
+}
+
+const Sidebar = (props: SidebarProps) => {
     const {
         children,
         closedSize,
@@ -70,7 +78,9 @@ const Sidebar = props => {
         theme.breakpoints.down('xs')
     );
     const isSmall = useMediaQuery<Theme>(theme => theme.breakpoints.down('sm'));
-    const open = useSelector<ReduxState>(state => state.admin.ui.sidebarOpen);
+    const open = useSelector<ReduxState, boolean>(
+        state => state.admin.ui.sidebarOpen
+    );
     useLocale(); // force redraw on locale change
     const handleClose = () => dispatch(setSidebarVisibility(false));
     const toggleSidebar = () => dispatch(setSidebarVisibility(!open));
diff --git a/packages/ra-ui-materialui/src/layout/index.ts b/packages/ra-ui-materialui/src/layout/index.ts
index 88333ab500e..9007bee43f8 100644
--- a/packages/ra-ui-materialui/src/layout/index.ts
+++ b/packages/ra-ui-materialui/src/layout/index.ts
@@ -10,8 +10,8 @@ import Layout from './Layout';
 import Loading from './Loading';
 import LinearProgress from './LinearProgress';
 import LoadingIndicator from './LoadingIndicator';
-import Menu from './Menu';
-import MenuItemLink from './MenuItemLink';
+import Menu, { MenuProps } from './Menu';
+import MenuItemLink, { MenuItemLinkProps } from './MenuItemLink';
 import NotFound from './NotFound';
 import Notification from './Notification';
 import Responsive from './Responsive';
@@ -21,6 +21,8 @@ import TitleForRecord from './TitleForRecord';
 import TopToolbar from './TopToolbar';
 import UserMenu from './UserMenu';
 
+export type { MenuProps, MenuItemLinkProps };
+
 export {
     AppBar,
     CardActions,
diff --git a/packages/ra-ui-materialui/src/list/SimpleList.tsx b/packages/ra-ui-materialui/src/list/SimpleList.tsx
index 29376a36fe4..efa246565fd 100644
--- a/packages/ra-ui-materialui/src/list/SimpleList.tsx
+++ b/packages/ra-ui-materialui/src/list/SimpleList.tsx
@@ -171,7 +171,7 @@ SimpleList.propTypes = {
 export type FunctionToElement = (
     record: Record,
     id: Identifier
-) => ReactElement;
+) => ReactElement | string;
 
 export interface SimpleListProps extends Omit<ListProps, 'classes'> {
     className?: string;
diff --git a/packages/ra-ui-materialui/src/list/datagrid/ExpandRowButton.tsx b/packages/ra-ui-materialui/src/list/datagrid/ExpandRowButton.tsx
index a39d13c3003..d819f84b3a3 100644
--- a/packages/ra-ui-materialui/src/list/datagrid/ExpandRowButton.tsx
+++ b/packages/ra-ui-materialui/src/list/datagrid/ExpandRowButton.tsx
@@ -1,6 +1,6 @@
 import * as React from 'react';
-import { memo } from 'react';
-import IconButton from '@material-ui/core/IconButton';
+import { ElementType, memo } from 'react';
+import IconButton, { IconButtonProps } from '@material-ui/core/IconButton';
 import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
 import classNames from 'classnames';
 import { useTranslate } from 'ra-core';
@@ -22,9 +22,9 @@ const ExpandRowButton = ({
             className={classNames(classes.expandIcon, {
                 [classes.expanded]: expanded,
             })}
-            component="div"
             tabIndex={-1}
             aria-hidden="true"
+            component="div"
             {...props}
         >
             <ExpandMoreIcon />
@@ -32,11 +32,11 @@ const ExpandRowButton = ({
     );
 };
 
-export interface ExpandRowButtonProps {
+export interface ExpandRowButtonProps extends IconButtonProps {
     classes?: any;
+    component?: ElementType;
     expanded: boolean;
-    expandContentId: string;
-    onClick?: (event: any) => void;
+    expandContentId?: string;
 }
 
 export default memo(ExpandRowButton);

From 5a63c4cfbef0a26faa0872bd7758726ac3056514 Mon Sep 17 00:00:00 2001
From: djhi <1122076+djhi@users.noreply.github.com>
Date: Fri, 25 Sep 2020 10:01:33 +0200
Subject: [PATCH 2/7] More fixes & exports

---
 packages/ra-core/src/dataProvider/index.ts      | 15 +++++++++++----
 packages/ra-ui-materialui/src/button/Button.tsx |  3 ++-
 .../src/button/DeleteWithConfirmButton.tsx      |  2 +-
 packages/ra-ui-materialui/src/button/index.ts   | 17 +++++++++++++----
 packages/ra-ui-materialui/src/types.ts          |  1 +
 5 files changed, 28 insertions(+), 10 deletions(-)

diff --git a/packages/ra-core/src/dataProvider/index.ts b/packages/ra-core/src/dataProvider/index.ts
index 82d61c50684..e55780331d3 100644
--- a/packages/ra-core/src/dataProvider/index.ts
+++ b/packages/ra-core/src/dataProvider/index.ts
@@ -7,11 +7,11 @@ import Query from './Query';
 import cacheDataProviderProxy from './cacheDataProviderProxy';
 import undoableEventEmitter from './undoableEventEmitter';
 import useDataProvider from './useDataProvider';
-import useMutation from './useMutation';
-import useQuery from './useQuery';
-import useQueryWithStore from './useQueryWithStore';
+import useMutation, { UseMutationValue } from './useMutation';
+import useQuery, { UseQueryValue } from './useQuery';
+import useQueryWithStore, { QueryOptions } from './useQueryWithStore';
 import withDataProvider from './withDataProvider';
-import useGetOne from './useGetOne';
+import useGetOne, { UseGetOneHookValue } from './useGetOne';
 import useGetList from './useGetList';
 import useGetMany from './useGetMany';
 import useGetManyReference from './useGetManyReference';
@@ -24,6 +24,13 @@ import useDeleteMany from './useDeleteMany';
 import useRefreshWhenVisible from './useRefreshWhenVisible';
 import useIsAutomaticRefreshEnabled from './useIsAutomaticRefreshEnabled';
 
+export type {
+    QueryOptions,
+    UseMutationValue,
+    UseQueryValue,
+    UseGetOneHookValue,
+};
+
 export {
     cacheDataProviderProxy,
     convertLegacyDataProvider,
diff --git a/packages/ra-ui-materialui/src/button/Button.tsx b/packages/ra-ui-materialui/src/button/Button.tsx
index 966afe6a80e..2a61a2ab2d3 100644
--- a/packages/ra-ui-materialui/src/button/Button.tsx
+++ b/packages/ra-ui-materialui/src/button/Button.tsx
@@ -13,6 +13,7 @@ import { ButtonProps as MuiButtonProps } from '@material-ui/core/Button';
 import { Theme } from '@material-ui/core';
 import classnames from 'classnames';
 import { Record, RedirectionSideEffect, useTranslate } from 'ra-core';
+import { LocationDescriptor } from 'history';
 
 /**
  * A generic Button with side icon. Only the icon is displayed on small screens.
@@ -133,7 +134,7 @@ interface Props {
     className?: string;
     color?: MuiPropTypes.Color;
     component?: ReactNode;
-    to?: string | { pathname: string; search: string };
+    to?: string | LocationDescriptor;
     disabled?: boolean;
     label?: string;
     size?: 'small' | 'medium' | 'large';
diff --git a/packages/ra-ui-materialui/src/button/DeleteWithConfirmButton.tsx b/packages/ra-ui-materialui/src/button/DeleteWithConfirmButton.tsx
index 751e62821f7..835f088f112 100644
--- a/packages/ra-ui-materialui/src/button/DeleteWithConfirmButton.tsx
+++ b/packages/ra-ui-materialui/src/button/DeleteWithConfirmButton.tsx
@@ -132,7 +132,7 @@ interface Props {
     undoable?: boolean;
 }
 
-type DeleteWithConfirmButtonProps = Props & ButtonProps;
+export type DeleteWithConfirmButtonProps = Props & ButtonProps;
 
 DeleteWithConfirmButton.propTypes = {
     basePath: PropTypes.string,
diff --git a/packages/ra-ui-materialui/src/button/index.ts b/packages/ra-ui-materialui/src/button/index.ts
index a489b8efa80..d48224d852b 100644
--- a/packages/ra-ui-materialui/src/button/index.ts
+++ b/packages/ra-ui-materialui/src/button/index.ts
@@ -5,9 +5,13 @@ import BulkExportButton from './BulkExportButton';
 import Button, { ButtonProps } from './Button';
 import CloneButton from './CloneButton';
 import CreateButton from './CreateButton';
-import DeleteButton from './DeleteButton';
-import DeleteWithConfirmButton from './DeleteWithConfirmButton';
-import DeleteWithUndoButton from './DeleteWithUndoButton';
+import DeleteButton, { DeleteButtonProps } from './DeleteButton';
+import DeleteWithConfirmButton, {
+    DeleteWithConfirmButtonProps,
+} from './DeleteWithConfirmButton';
+import DeleteWithUndoButton, {
+    DeleteWithUndoButtonProps,
+} from './DeleteWithUndoButton';
 import EditButton from './EditButton';
 import ExportButton from './ExportButton';
 import ListButton from './ListButton';
@@ -17,7 +21,12 @@ import SortButton from './SortButton';
 import RefreshButton from './RefreshButton';
 import RefreshIconButton from './RefreshIconButton';
 
-export type { ButtonProps };
+export type {
+    ButtonProps,
+    DeleteButtonProps,
+    DeleteWithConfirmButtonProps,
+    DeleteWithUndoButtonProps,
+};
 
 export {
     BulkDeleteButton,
diff --git a/packages/ra-ui-materialui/src/types.ts b/packages/ra-ui-materialui/src/types.ts
index 8ac1192508e..e75fd0143d2 100644
--- a/packages/ra-ui-materialui/src/types.ts
+++ b/packages/ra-ui-materialui/src/types.ts
@@ -48,6 +48,7 @@ export interface CreateProps extends ResourceComponentProps {
     classes?: any;
     className?: string;
     component?: ElementType;
+    record?: Partial<RaRecord>;
     onSuccess?: (data: RaRecord) => void;
     onFailure?: (error: any) => void;
     transform?: (data: RaRecord) => RaRecord;

From 3a816ba2d177dfce4edd4398188fda96a2d7de91 Mon Sep 17 00:00:00 2001
From: djhi <1122076+djhi@users.noreply.github.com>
Date: Fri, 25 Sep 2020 12:07:49 +0200
Subject: [PATCH 3/7] Try fixing deps to last version

---
 examples/demo/package.json                   | 16 ++--
 examples/simple/package.json                 | 10 +--
 examples/tutorial/package.json               |  4 +-
 packages/ra-data-fakerest/package.json       |  2 +-
 packages/ra-data-graphql-simple/package.json |  2 +-
 packages/ra-data-graphql/package.json        |  2 +-
 packages/ra-data-simple-rest/package.json    |  2 +-
 packages/ra-input-rich-text/package.json     |  4 +-
 packages/ra-ui-materialui/package.json       |  2 +-
 yarn.lock                                    | 79 ++++++++++++++++++++
 10 files changed, 101 insertions(+), 22 deletions(-)

diff --git a/examples/demo/package.json b/examples/demo/package.json
index 7f4ba46590b..c31691c9b54 100644
--- a/examples/demo/package.json
+++ b/examples/demo/package.json
@@ -12,13 +12,13 @@
         "fetch-mock": "~6.3.0",
         "json-graphql-server": "~2.1.3",
         "proxy-polyfill": "^0.3.0",
-        "ra-data-fakerest": "^3.0.0",
-        "ra-data-graphql-simple": "^3.0.0",
-        "ra-data-simple-rest": "^3.0.0",
-        "ra-i18n-polyglot": "^3.0.0",
-        "ra-input-rich-text": "^3.0.0",
-        "ra-language-english": "^3.0.0",
-        "ra-language-french": "^3.0.0",
+        "ra-data-fakerest": "^3.9.0-beta.1",
+        "ra-data-graphql-simple": "^3.9.0-beta.1",
+        "ra-data-simple-rest": "^3.9.0-beta.1",
+        "ra-i18n-polyglot": "^3.9.0-beta.1",
+        "ra-input-rich-text": "^3.9.0-beta.1",
+        "ra-language-english": "^3.9.0-beta.1",
+        "ra-language-french": "^3.9.0-beta.1",
         "react": "^16.9.0",
         "react-admin": "^3.0.0",
         "react-app-polyfill": "^1.0.4",
@@ -54,4 +54,4 @@
         "source-map-explorer": "^2.0.0",
         "typescript": "^4.0.2"
     }
-}
\ No newline at end of file
+}
diff --git a/examples/simple/package.json b/examples/simple/package.json
index 6bbc6929d35..3a2be12457a 100644
--- a/examples/simple/package.json
+++ b/examples/simple/package.json
@@ -37,11 +37,11 @@
         "@babel/polyfill": "^7.10.4",
         "@material-ui/core": "^4.10.0",
         "@material-ui/icons": "^4.9.1",
-        "ra-data-fakerest": "^3.0.0",
-        "ra-i18n-polyglot": "^3.0.0",
-        "ra-input-rich-text": "^3.0.0",
-        "ra-language-english": "^3.0.0",
-        "ra-language-french": "^3.0.0",
+        "ra-data-fakerest": "^3.9.0-beta.1",
+        "ra-i18n-polyglot": "^3.9.0-beta.1",
+        "ra-input-rich-text": "^3.9.0-beta.1",
+        "ra-language-english": "^3.9.0-beta.1",
+        "ra-language-french": "^3.9.0-beta.1",
         "react": "^16.9.0",
         "react-admin": "^3.0.0",
         "react-dom": "^16.9.0"
diff --git a/examples/tutorial/package.json b/examples/tutorial/package.json
index 308f30abdd4..6e290f32ce7 100644
--- a/examples/tutorial/package.json
+++ b/examples/tutorial/package.json
@@ -4,7 +4,7 @@
     "private": true,
     "dependencies": {
         "@material-ui/core": "^4.10.0",
-        "ra-data-json-server": "^3.0.0",
+        "ra-data-json-server": "^3.9.0-beta.1",
         "react": "^16.9.0",
         "react-admin": "^3.0.0",
         "react-dom": "^16.9.0",
@@ -21,4 +21,4 @@
         "not ie <= 11",
         "not op_mini all"
     ]
-}
\ No newline at end of file
+}
diff --git a/packages/ra-data-fakerest/package.json b/packages/ra-data-fakerest/package.json
index 6c7632990ab..7bec2b4a65d 100644
--- a/packages/ra-data-fakerest/package.json
+++ b/packages/ra-data-fakerest/package.json
@@ -44,6 +44,6 @@
         "rimraf": "^2.6.3"
     },
     "peerDependencies": {
-        "ra-core": "^3.0.0"
+        "ra-core": "^3.9.0-beta.1"
     }
 }
diff --git a/packages/ra-data-graphql-simple/package.json b/packages/ra-data-graphql-simple/package.json
index 883d26d5d43..0f9e1650ad8 100644
--- a/packages/ra-data-graphql-simple/package.json
+++ b/packages/ra-data-graphql-simple/package.json
@@ -40,7 +40,7 @@
     },
     "peerDependencies": {
         "graphql": "^14.1.1",
-        "ra-core": "^3.0.0"
+        "ra-core": "^3.9.0-beta.1"
     },
     "devDependencies": {
         "cross-env": "^5.2.0",
diff --git a/packages/ra-data-graphql/package.json b/packages/ra-data-graphql/package.json
index a0cb5128ff3..bfc83bea35b 100644
--- a/packages/ra-data-graphql/package.json
+++ b/packages/ra-data-graphql/package.json
@@ -40,7 +40,7 @@
     },
     "peerDependencies": {
         "graphql": "^14.1.1",
-        "ra-core": "^3.0.0"
+        "ra-core": "^3.9.0-beta.1"
     },
     "devDependencies": {
         "cross-env": "^5.2.0",
diff --git a/packages/ra-data-simple-rest/package.json b/packages/ra-data-simple-rest/package.json
index aaa387686db..1fe87910123 100644
--- a/packages/ra-data-simple-rest/package.json
+++ b/packages/ra-data-simple-rest/package.json
@@ -32,6 +32,6 @@
         "rimraf": "^2.6.3"
     },
     "peerDependencies": {
-        "ra-core": "^3.0.0"
+        "ra-core": "^3.9.0-beta.1"
     }
 }
diff --git a/packages/ra-input-rich-text/package.json b/packages/ra-input-rich-text/package.json
index 75010a3f86a..3ab1800dc4e 100644
--- a/packages/ra-input-rich-text/package.json
+++ b/packages/ra-input-rich-text/package.json
@@ -40,8 +40,8 @@
         "watch": "tsc --outDir esm --module es2015 --watch"
     },
     "peerDependencies": {
-        "ra-core": "^3.0.0",
-        "ra-ui-materialui": "^4.3.3",
+        "ra-core": "^3.9.0-beta.1",
+        "ra-ui-materialui": "^3.9.0-beta.1",
         "react": "^16.9.0",
         "react-dom": "^16.9.0"
     },
diff --git a/packages/ra-ui-materialui/package.json b/packages/ra-ui-materialui/package.json
index c99d44973b4..6aa5f4a44a6 100644
--- a/packages/ra-ui-materialui/package.json
+++ b/packages/ra-ui-materialui/package.json
@@ -56,7 +56,7 @@
         "@material-ui/styles": "^4.3.3",
         "final-form": "^4.18.5",
         "final-form-arrays": "^3.0.1",
-        "ra-core": "^3.0.0",
+        "ra-core": "^3.9.0-beta.1",
         "react": "^16.9.0",
         "react-dom": "^16.9.0",
         "react-final-form": "^6.3.3",
diff --git a/yarn.lock b/yarn.lock
index fca7fe0f023..81b6a38a96a 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -6498,6 +6498,14 @@ dashdash@^1.12.0:
   dependencies:
     assert-plus "^1.0.0"
 
+data-generator-retail@^3.0.0:
+  version "3.8.3"
+  resolved "https://registry.yarnpkg.com/data-generator-retail/-/data-generator-retail-3.8.3.tgz#2a87f3fa88c1e814c50eb2ee0eecb62016d9294d"
+  integrity sha512-pUN1f23q+irCFEoBU05cPQj3+NMB1u00XXyw02TlXUQ698wgL5Oc6ey0aftCk9MqpZFM+znZidwEtyIiMHMbzg==
+  dependencies:
+    date-fns "~1.29.0"
+    faker "^4.1.0"
+
 data-urls@^1.0.0, data-urls@^1.1.0:
   version "1.1.0"
   resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-1.1.0.tgz#15ee0582baa5e22bb59c77140da8f9c76963bbfe"
@@ -14442,6 +14450,54 @@ quill@~1.3.6:
     parchment "^1.1.4"
     quill-delta "^3.6.2"
 
+ra-core@^3.8.5:
+  version "3.8.5"
+  resolved "https://registry.yarnpkg.com/ra-core/-/ra-core-3.8.5.tgz#d39c3bfe6eaa60ad06509e72f63591ac5540039e"
+  integrity sha512-TLZqREIb5B1lZGJDOBmu1+SN+kXgHQSVjp5KWW1/AOvw1N99uCkciOKnWiF8LBkCCvM/zNREFIV/Yh6FTf2Rlw==
+  dependencies:
+    "@testing-library/react" "^8.0.7"
+    classnames "~2.2.5"
+    date-fns "^1.29.0"
+    eventemitter3 "^3.0.0"
+    inflection "~1.12.0"
+    lodash "~4.17.5"
+    prop-types "^15.6.1"
+    query-string "^5.1.1"
+    reselect "~3.0.0"
+
+ra-i18n-polyglot@^3.8.5:
+  version "3.8.5"
+  resolved "https://registry.yarnpkg.com/ra-i18n-polyglot/-/ra-i18n-polyglot-3.8.5.tgz#f59a17a757234add7164cbce6fc0a95a925f0065"
+  integrity sha512-ck3g3eZHb5jm0IdKpljSyMvlcH38esjFJBbGxKoGx8sQM3v0T1TtnErI2/s+VGTPFC53n5jqnjKPbfzqV7js/g==
+  dependencies:
+    node-polyglot "^2.2.2"
+    ra-core "^3.8.5"
+
+ra-language-english@^3.8.5:
+  version "3.8.5"
+  resolved "https://registry.yarnpkg.com/ra-language-english/-/ra-language-english-3.8.5.tgz#d31f40a7836972fe252c3c98643f246afde24899"
+  integrity sha512-j8O/AMGQaEWzRyQpY1tU3erCozmPdX0AHE+tZM7hNBY34MGmIeqhnySc7o7rBN4gS8vGU1tIejgld8xu0QOMdg==
+  dependencies:
+    ra-core "^3.8.5"
+
+ra-ui-materialui@^3.8.5:
+  version "3.8.5"
+  resolved "https://registry.yarnpkg.com/ra-ui-materialui/-/ra-ui-materialui-3.8.5.tgz#3e449befd135c3da7d192dfa629355f0696fae03"
+  integrity sha512-xe0KznjJNy5hJZH+MHLnKPZhp9WvEoORZJv6TpI5tOWPuTRxrT6xrDt3WtwdDJ4SDau5AjUu+4duyjwPsERn9A==
+  dependencies:
+    autosuggest-highlight "^3.1.1"
+    classnames "~2.2.5"
+    connected-react-router "^6.5.2"
+    css-mediaquery "^0.1.2"
+    downshift "3.2.7"
+    inflection "~1.12.0"
+    jsonexport "^2.4.1"
+    lodash "~4.17.5"
+    prop-types "^15.7.0"
+    query-string "^5.1.1"
+    react-dropzone "^10.1.7"
+    react-transition-group "^4.4.1"
+
 raf@^3.4.0, raf@^3.4.1, raf@~3.4.1:
   version "3.4.1"
   resolved "https://registry.yarnpkg.com/raf/-/raf-3.4.1.tgz#0742e99a4a6552f445d73e3ee0328af0ff1ede39"
@@ -14546,6 +14602,29 @@ rc@^1.0.1, rc@^1.1.6:
     minimist "^1.2.0"
     strip-json-comments "~2.0.1"
 
+react-admin@^3.0.0:
+  version "3.8.5"
+  resolved "https://registry.yarnpkg.com/react-admin/-/react-admin-3.8.5.tgz#37418758455544617a189f3bcc822567f5309750"
+  integrity sha512-jTxZG7E3efVNZ4MGgBnlYm/dw5m63S+sgHcOw+mlh4xTch8KZgwlJxik59Rejtm2K8bjR2yc4p91XZw83IlwUA==
+  dependencies:
+    "@material-ui/core" "^4.3.3"
+    "@material-ui/icons" "^4.2.1"
+    "@material-ui/styles" "^4.3.3"
+    connected-react-router "^6.5.2"
+    final-form "^4.18.5"
+    final-form-arrays "^3.0.1"
+    ra-core "^3.8.5"
+    ra-i18n-polyglot "^3.8.5"
+    ra-language-english "^3.8.5"
+    ra-ui-materialui "^3.8.5"
+    react-final-form "^6.3.3"
+    react-final-form-arrays "^3.1.1"
+    react-redux "^7.1.0"
+    react-router "^5.1.0"
+    react-router-dom "^5.1.0"
+    redux "^3.7.2 || ^4.0.3"
+    redux-saga "^1.0.0"
+
 react-app-polyfill@^1.0.4, react-app-polyfill@^1.0.6:
   version "1.0.6"
   resolved "https://registry.yarnpkg.com/react-app-polyfill/-/react-app-polyfill-1.0.6.tgz#890f8d7f2842ce6073f030b117de9130a5f385f0"

From 99c27652eeb2be73d5094b557eed213f08493f9d Mon Sep 17 00:00:00 2001
From: djhi <1122076+djhi@users.noreply.github.com>
Date: Fri, 25 Sep 2020 14:30:38 +0200
Subject: [PATCH 4/7] Try upgrading demo packages

---
 examples/demo/package.json     |  2 +-
 examples/simple/package.json   |  2 +-
 examples/tutorial/package.json |  2 +-
 yarn.lock                      | 64 +++++-----------------------------
 4 files changed, 11 insertions(+), 59 deletions(-)

diff --git a/examples/demo/package.json b/examples/demo/package.json
index c31691c9b54..475776c2926 100644
--- a/examples/demo/package.json
+++ b/examples/demo/package.json
@@ -20,7 +20,7 @@
         "ra-language-english": "^3.9.0-beta.1",
         "ra-language-french": "^3.9.0-beta.1",
         "react": "^16.9.0",
-        "react-admin": "^3.0.0",
+        "react-admin": "next",
         "react-app-polyfill": "^1.0.4",
         "react-dom": "^16.9.0",
         "react-redux": "^7.1.0",
diff --git a/examples/simple/package.json b/examples/simple/package.json
index 3a2be12457a..b964432cdd2 100644
--- a/examples/simple/package.json
+++ b/examples/simple/package.json
@@ -43,7 +43,7 @@
         "ra-language-english": "^3.9.0-beta.1",
         "ra-language-french": "^3.9.0-beta.1",
         "react": "^16.9.0",
-        "react-admin": "^3.0.0",
+        "react-admin": "next",
         "react-dom": "^16.9.0"
     }
 }
diff --git a/examples/tutorial/package.json b/examples/tutorial/package.json
index 6e290f32ce7..8f25f3d8cba 100644
--- a/examples/tutorial/package.json
+++ b/examples/tutorial/package.json
@@ -6,7 +6,7 @@
         "@material-ui/core": "^4.10.0",
         "ra-data-json-server": "^3.9.0-beta.1",
         "react": "^16.9.0",
-        "react-admin": "^3.0.0",
+        "react-admin": "next",
         "react-dom": "^16.9.0",
         "react-scripts": "^3.0.0"
     },
diff --git a/yarn.lock b/yarn.lock
index 81b6a38a96a..4c29fd1d5fa 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -14450,54 +14450,6 @@ quill@~1.3.6:
     parchment "^1.1.4"
     quill-delta "^3.6.2"
 
-ra-core@^3.8.5:
-  version "3.8.5"
-  resolved "https://registry.yarnpkg.com/ra-core/-/ra-core-3.8.5.tgz#d39c3bfe6eaa60ad06509e72f63591ac5540039e"
-  integrity sha512-TLZqREIb5B1lZGJDOBmu1+SN+kXgHQSVjp5KWW1/AOvw1N99uCkciOKnWiF8LBkCCvM/zNREFIV/Yh6FTf2Rlw==
-  dependencies:
-    "@testing-library/react" "^8.0.7"
-    classnames "~2.2.5"
-    date-fns "^1.29.0"
-    eventemitter3 "^3.0.0"
-    inflection "~1.12.0"
-    lodash "~4.17.5"
-    prop-types "^15.6.1"
-    query-string "^5.1.1"
-    reselect "~3.0.0"
-
-ra-i18n-polyglot@^3.8.5:
-  version "3.8.5"
-  resolved "https://registry.yarnpkg.com/ra-i18n-polyglot/-/ra-i18n-polyglot-3.8.5.tgz#f59a17a757234add7164cbce6fc0a95a925f0065"
-  integrity sha512-ck3g3eZHb5jm0IdKpljSyMvlcH38esjFJBbGxKoGx8sQM3v0T1TtnErI2/s+VGTPFC53n5jqnjKPbfzqV7js/g==
-  dependencies:
-    node-polyglot "^2.2.2"
-    ra-core "^3.8.5"
-
-ra-language-english@^3.8.5:
-  version "3.8.5"
-  resolved "https://registry.yarnpkg.com/ra-language-english/-/ra-language-english-3.8.5.tgz#d31f40a7836972fe252c3c98643f246afde24899"
-  integrity sha512-j8O/AMGQaEWzRyQpY1tU3erCozmPdX0AHE+tZM7hNBY34MGmIeqhnySc7o7rBN4gS8vGU1tIejgld8xu0QOMdg==
-  dependencies:
-    ra-core "^3.8.5"
-
-ra-ui-materialui@^3.8.5:
-  version "3.8.5"
-  resolved "https://registry.yarnpkg.com/ra-ui-materialui/-/ra-ui-materialui-3.8.5.tgz#3e449befd135c3da7d192dfa629355f0696fae03"
-  integrity sha512-xe0KznjJNy5hJZH+MHLnKPZhp9WvEoORZJv6TpI5tOWPuTRxrT6xrDt3WtwdDJ4SDau5AjUu+4duyjwPsERn9A==
-  dependencies:
-    autosuggest-highlight "^3.1.1"
-    classnames "~2.2.5"
-    connected-react-router "^6.5.2"
-    css-mediaquery "^0.1.2"
-    downshift "3.2.7"
-    inflection "~1.12.0"
-    jsonexport "^2.4.1"
-    lodash "~4.17.5"
-    prop-types "^15.7.0"
-    query-string "^5.1.1"
-    react-dropzone "^10.1.7"
-    react-transition-group "^4.4.1"
-
 raf@^3.4.0, raf@^3.4.1, raf@~3.4.1:
   version "3.4.1"
   resolved "https://registry.yarnpkg.com/raf/-/raf-3.4.1.tgz#0742e99a4a6552f445d73e3ee0328af0ff1ede39"
@@ -14602,10 +14554,10 @@ rc@^1.0.1, rc@^1.1.6:
     minimist "^1.2.0"
     strip-json-comments "~2.0.1"
 
-react-admin@^3.0.0:
-  version "3.8.5"
-  resolved "https://registry.yarnpkg.com/react-admin/-/react-admin-3.8.5.tgz#37418758455544617a189f3bcc822567f5309750"
-  integrity sha512-jTxZG7E3efVNZ4MGgBnlYm/dw5m63S+sgHcOw+mlh4xTch8KZgwlJxik59Rejtm2K8bjR2yc4p91XZw83IlwUA==
+react-admin@next:
+  version "3.9.0-beta.1"
+  resolved "https://registry.yarnpkg.com/react-admin/-/react-admin-3.9.0-beta.1.tgz#b23fb8647115d594c8f21f6918c5838ab74d601b"
+  integrity sha512-kNieDYyWeW4zs0yS8zzhv9BXOpJqroHEvTzABrupYtPrU6Z8CX+iBrgyAGehVu2NruCZB+kDGRRkdcnbyVg57A==
   dependencies:
     "@material-ui/core" "^4.3.3"
     "@material-ui/icons" "^4.2.1"
@@ -14613,10 +14565,10 @@ react-admin@^3.0.0:
     connected-react-router "^6.5.2"
     final-form "^4.18.5"
     final-form-arrays "^3.0.1"
-    ra-core "^3.8.5"
-    ra-i18n-polyglot "^3.8.5"
-    ra-language-english "^3.8.5"
-    ra-ui-materialui "^3.8.5"
+    ra-core "^3.9.0-beta.1"
+    ra-i18n-polyglot "^3.9.0-beta.1"
+    ra-language-english "^3.9.0-beta.1"
+    ra-ui-materialui "^3.9.0-beta.1"
     react-final-form "^6.3.3"
     react-final-form-arrays "^3.1.1"
     react-redux "^7.1.0"

From 55391077b52ac241c1dff9dc14a9e47dde7b94fe Mon Sep 17 00:00:00 2001
From: djhi <1122076+djhi@users.noreply.github.com>
Date: Fri, 25 Sep 2020 15:46:36 +0200
Subject: [PATCH 5/7] Fix examples deps

---
 examples/demo/package.json     | 2 +-
 examples/simple/package.json   | 2 +-
 examples/tutorial/package.json | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/examples/demo/package.json b/examples/demo/package.json
index 475776c2926..9d2b88a906a 100644
--- a/examples/demo/package.json
+++ b/examples/demo/package.json
@@ -20,7 +20,7 @@
         "ra-language-english": "^3.9.0-beta.1",
         "ra-language-french": "^3.9.0-beta.1",
         "react": "^16.9.0",
-        "react-admin": "next",
+        "react-admin": "^3.9.0-beta.1",
         "react-app-polyfill": "^1.0.4",
         "react-dom": "^16.9.0",
         "react-redux": "^7.1.0",
diff --git a/examples/simple/package.json b/examples/simple/package.json
index b964432cdd2..f8ec4344d40 100644
--- a/examples/simple/package.json
+++ b/examples/simple/package.json
@@ -43,7 +43,7 @@
         "ra-language-english": "^3.9.0-beta.1",
         "ra-language-french": "^3.9.0-beta.1",
         "react": "^16.9.0",
-        "react-admin": "next",
+        "react-admin": "^3.9.0-beta.1",
         "react-dom": "^16.9.0"
     }
 }
diff --git a/examples/tutorial/package.json b/examples/tutorial/package.json
index 8f25f3d8cba..5b527112d77 100644
--- a/examples/tutorial/package.json
+++ b/examples/tutorial/package.json
@@ -6,7 +6,7 @@
         "@material-ui/core": "^4.10.0",
         "ra-data-json-server": "^3.9.0-beta.1",
         "react": "^16.9.0",
-        "react-admin": "next",
+        "react-admin": "^3.9.0-beta.1",
         "react-dom": "^16.9.0",
         "react-scripts": "^3.0.0"
     },

From e9a0d50d6c0188d4d88906746acc131f7cc4d687 Mon Sep 17 00:00:00 2001
From: djhi <1122076+djhi@users.noreply.github.com>
Date: Fri, 25 Sep 2020 15:47:16 +0200
Subject: [PATCH 6/7] update yarn.lock

---
 yarn.lock | 23 -----------------------
 1 file changed, 23 deletions(-)

diff --git a/yarn.lock b/yarn.lock
index 4c29fd1d5fa..93a2829eea5 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -14554,29 +14554,6 @@ rc@^1.0.1, rc@^1.1.6:
     minimist "^1.2.0"
     strip-json-comments "~2.0.1"
 
-react-admin@next:
-  version "3.9.0-beta.1"
-  resolved "https://registry.yarnpkg.com/react-admin/-/react-admin-3.9.0-beta.1.tgz#b23fb8647115d594c8f21f6918c5838ab74d601b"
-  integrity sha512-kNieDYyWeW4zs0yS8zzhv9BXOpJqroHEvTzABrupYtPrU6Z8CX+iBrgyAGehVu2NruCZB+kDGRRkdcnbyVg57A==
-  dependencies:
-    "@material-ui/core" "^4.3.3"
-    "@material-ui/icons" "^4.2.1"
-    "@material-ui/styles" "^4.3.3"
-    connected-react-router "^6.5.2"
-    final-form "^4.18.5"
-    final-form-arrays "^3.0.1"
-    ra-core "^3.9.0-beta.1"
-    ra-i18n-polyglot "^3.9.0-beta.1"
-    ra-language-english "^3.9.0-beta.1"
-    ra-ui-materialui "^3.9.0-beta.1"
-    react-final-form "^6.3.3"
-    react-final-form-arrays "^3.1.1"
-    react-redux "^7.1.0"
-    react-router "^5.1.0"
-    react-router-dom "^5.1.0"
-    redux "^3.7.2 || ^4.0.3"
-    redux-saga "^1.0.0"
-
 react-app-polyfill@^1.0.4, react-app-polyfill@^1.0.6:
   version "1.0.6"
   resolved "https://registry.yarnpkg.com/react-app-polyfill/-/react-app-polyfill-1.0.6.tgz#890f8d7f2842ce6073f030b117de9130a5f385f0"

From 54f0ed02b48c5ee2f1fd0092ce61e8422a935100 Mon Sep 17 00:00:00 2001
From: djhi <1122076+djhi@users.noreply.github.com>
Date: Sat, 26 Sep 2020 07:09:24 +0200
Subject: [PATCH 7/7] Fix data-ganerator dependency

---
 examples/demo/package.json | 2 +-
 yarn.lock                  | 8 --------
 2 files changed, 1 insertion(+), 9 deletions(-)

diff --git a/examples/demo/package.json b/examples/demo/package.json
index 9d2b88a906a..e216c13bae9 100644
--- a/examples/demo/package.json
+++ b/examples/demo/package.json
@@ -7,7 +7,7 @@
         "@material-ui/icons": "^4.9.1",
         "@types/inflection": "^1.5.28",
         "@types/recharts": "^1.8.10",
-        "data-generator-retail": "^3.0.0",
+        "data-generator-retail": "^3.9.0-beta.1",
         "fakerest": "~2.1.0",
         "fetch-mock": "~6.3.0",
         "json-graphql-server": "~2.1.3",
diff --git a/yarn.lock b/yarn.lock
index 93a2829eea5..fca7fe0f023 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -6498,14 +6498,6 @@ dashdash@^1.12.0:
   dependencies:
     assert-plus "^1.0.0"
 
-data-generator-retail@^3.0.0:
-  version "3.8.3"
-  resolved "https://registry.yarnpkg.com/data-generator-retail/-/data-generator-retail-3.8.3.tgz#2a87f3fa88c1e814c50eb2ee0eecb62016d9294d"
-  integrity sha512-pUN1f23q+irCFEoBU05cPQj3+NMB1u00XXyw02TlXUQ698wgL5Oc6ey0aftCk9MqpZFM+znZidwEtyIiMHMbzg==
-  dependencies:
-    date-fns "~1.29.0"
-    faker "^4.1.0"
-
 data-urls@^1.0.0, data-urls@^1.1.0:
   version "1.1.0"
   resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-1.1.0.tgz#15ee0582baa5e22bb59c77140da8f9c76963bbfe"