I have a problem developing the front end. Whenever I change Dashboard.tsx
, the webpage does not automatically update. These are the error
Compiled successfully!
You can now view frontend in the browser.
Local: http://localhost:3000
On Your Network: http://172.31.71.205:3000
Note that the development build is not optimized.
To create a production build, use yarn build.
webpack compiled successfully
Files successfully emitted, waiting for typecheck results...
Issues checking in progress...
ERROR in src/App.tsx:43:10
TS2786: 'Route' cannot be used as a JSX component.
Its type '(_props: RouteProps) => ReactElement<any, string | JSXElementConstructor<any>> | null' is not a valid JSX element type.
Type '(_props: RouteProps) => ReactElement<any, string | JSXElementConstructor<any>> | null' is not assignable to type '(props: any, deprecatedLegacyContext?: any) => ReactNode'.
Type 'ReactElement<any, string | JSXElementConstructor<any>> | null' is not assignable to type 'ReactNode'.
Type 'ReactElement<any, string | JSXElementConstructor<any>>' is not assignable to type 'ReactNode'.
Property 'children' is missing in type 'ReactElement<any, string | JSXElementConstructor<any>>' but required in type 'ReactPortal'.
41 | >
42 | <CustomRoutes>
> 43 | <Route path="/my-profile" element={<ProfileEdit />} />
| ^^^^^
44 | </CustomRoutes>
45 | <CustomRoutes noLayout>
46 | <Route path="/register" element={<Register />} />
ERROR in src/App.tsx:46:10
TS2786: 'Route' cannot be used as a JSX component.
Its type '(_props: RouteProps) => ReactElement<any, string | JSXElementConstructor<any>> | null' is not a valid JSX element type.
44 | </CustomRoutes>
45 | <CustomRoutes noLayout>
> 46 | <Route path="/register" element={<Register /> as any} />
| ^^^^^
47 | </CustomRoutes>
48 | {(permissions) => [
49 | permissions.is_superuser === true ? (
ERROR in src/components/AdminLayout.tsx:8:8
TS2786: 'MenuItemLink' cannot be used as a JSX component.
Its type 'ForwardRefExoticComponent<Pick<MenuItemLinkProps, "replace" | "id" | "children" | "value" | "slot" | "style" | "title" | "type" | "key" | "className" | "resource" | "classes" | "disableGutters" | ... 275 more ... | "tooltipProps"> & RefAttributes<...>>' is not a valid JSX element type.
Type 'ForwardRefExoticComponent<Pick<MenuItemLinkProps, "replace" | "id" | "children" | "value" | "slot" | "style" | "title" | "type" | "key" | "className" | "resource" | "classes" | "disableGutters" | ... 275 more ... | "tooltipProps"> & RefAttributes<...>>' is not assignable to type '(props: any, deprecatedLegacyContext?: any) => ReactNode'.
Type 'ReactElement<any, string | JSXElementConstructor<any>> | null' is not assignable to type 'ReactNode'.
6 | return (
7 | <UserMenu {...props}>
> 8 | <MenuItemLink
| ^^^^^^^^^^^^
9 | to="/my-profile"
10 | primaryText="My Profile"
11 | leftIcon={<SettingsIcon />}
ERROR in src/index.tsx:8:4
TS2786: 'React.StrictMode' cannot be used as a JSX component.
Its type 'ExoticComponent<{ children?: ReactNode; }>' is not a valid JSX element type.
Type 'ExoticComponent<{ children?: ReactNode; }>' is not assignable to type '(props: any, deprecatedLegacyContext?: any) => ReactNode'.
Type 'ReactElement<any, string | JSXElementConstructor<any>> | null' is not assignable to type 'ReactNode'.
6 |
7 | ReactDOM.render(
> 8 | <React.StrictMode>
| ^^^^^^^^^^^^^^^^
9 | <App />
10 | </React.StrictMode>,
11 | document.getElementById("root")
ERROR in src/pages/Items.tsx:13:4
TS2786: 'List' cannot be used as a JSX component.
Its type '{ <RecordType extends RaRecord<Identifier> = any>({ debounce, disableAuthentication, disableSyncWithLocation, exporter, filter, filterDefaultValues, perPage, queryOptions, resource, sort, storeKey, ...rest }: ListProps<RecordType>): ReactElement<any, string | JSXElementConstructor<any>>; propTypes: { ...; }; }' is not a valid JSX element type.
Type '{ <RecordType extends RaRecord<Identifier> = any>({ debounce, disableAuthentication, disableSyncWithLocation, exporter, filter, filterDefaultValues, perPage, queryOptions, resource, sort, storeKey, ...rest }: ListProps<RecordType>): ReactElement<any, string | JSXElementConstructor<any>>; propTypes: { ...; }; }' is not assignable to type '(props: any, deprecatedLegacyContext?: any) => ReactNode'.
Type 'ReactElement<any, string | JSXElementConstructor<any>>' is not assignable to type 'ReactNode'.
11 |
12 | export const ItemList = (props: any) => (
> 13 | <List {...props} filters={[]}>
| ^^^^
14 | <Datagrid>
15 | <TextField source="value" />
16 | <TextField source="id" />
ERROR in src/pages/Items.tsx:31:4
TS2786: 'Create' cannot be used as a JSX component.
Its type '{ <RecordType extends Omit<RaRecord<Identifier>, "id"> = any, ResultRecordType extends RaRecord<Identifier> = RecordType & { id: Identifier; }>(props: CreateProps<...> & { ...; }): ReactElement<...>; propTypes: { ...; }; }' is not a valid JSX element type.
Type '{ <RecordType extends Omit<RaRecord<Identifier>, "id"> = any, ResultRecordType extends RaRecord<Identifier> = RecordType & { id: Identifier; }>(props: CreateProps<...> & { ...; }): ReactElement<...>; propTypes: { ...; }; }' is not assignable to type '(props: any, deprecatedLegacyContext?: any) => ReactNode'.
Type 'ReactElement<any, string | JSXElementConstructor<any>>' is not assignable to type 'ReactNode'.
29 |
30 | export const ItemCreate = (props: any) => (
> 31 | <Create {...props}>
| ^^^^^^
32 | <SimpleForm>
33 | <TextInput source="value" />
34 | </SimpleForm>
ERROR in src/pages/ProfileEdit.tsx:39:6
TS2786: 'ProfileContext.Provider' cannot be used as a JSX component.
Its type 'Provider<{ profileVersion: number; refreshProfile: () => void; }>' is not a valid JSX element type.
Type 'ProviderExoticComponent<ProviderProps<{ profileVersion: number; refreshProfile: () => void; }>>' is not assignable to type '(props: any, deprecatedLegacyContext?: any) => ReactNode'.
Type 'ReactElement<any, string | JSXElementConstructor<any>> | null' is not assignable to type 'ReactNode'.
Type 'ReactElement<any, string | JSXElementConstructor<any>>' is not assignable to type 'ReactNode'.
Property 'children' is missing in type 'ReactElement<any, string | JSXElementConstructor<any>>' but required in type 'ReactPortal'.
37 |
38 | return (
| ^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^
40 | {children}
41 | </ProfileContext.Provider>
42 | );
ERROR in src/pages/Users.tsx:15:4
TS2786: 'List' cannot be used as a JSX component.
Its type '{ <RecordType extends RaRecord<Identifier> = any>({ debounce, disableAuthentication, disableSyncWithLocation, exporter, filter, filterDefaultValues, perPage, queryOptions, resource, sort, storeKey, ...rest }: ListProps<RecordType>): ReactElement<any, string | JSXElementConstructor<any>>; propTypes: { ...; }; }' is not a valid JSX element type.
13 |
14 | export const UserList = (props: any) => (
> 15 | <List {...props}>
| ^^^^
16 | <Datagrid>
17 | <TextField source="id" />
18 | <EmailField source="email" />