-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Doc] Update the tutorial to use Vite instead of create-react-app #8351
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last thing, I have the following error when running the tutorial locally and browsing to PostEdit
:
MUI: Too many re-renders. The layout is unstable.TextareaAutosize limits the number of renders to prevent an infinite loop.
at TextareaAutosize2 (http://localhost:5173/node_modules/.vite/deps/chunk-SWNXBIQZ.js?v=db5d3159:7879:9)
at http://localhost:5173/node_modules/.vite/deps/chunk-SWNXBIQZ.js?v=db5d3159:9627:50
at div
at http://localhost:5173/node_modules/.vite/deps/chunk-SWNXBIQZ.js?v=db5d3159:9627:50
at InputBase2 (http://localhost:5173/node_modules/.vite/deps/chunk-PQ3CTUUK.js?v=db5d3159:337:17)
at FilledInput2 (http://localhost:5173/node_modules/.vite/deps/chunk-PQ3CTUUK.js?v=db5d3159:979:17)
at div
at http://localhost:5173/node_modules/.vite/deps/chunk-SWNXBIQZ.js?v=db5d3159:9627:50
at FormControl2 (http://localhost:5173/node_modules/.vite/deps/chunk-YDPHP4B3.js?v=db5d3159:123:17)
at http://localhost:5173/node_modules/.vite/deps/chunk-SWNXBIQZ.js?v=db5d3159:9627:50
at TextField2 (http://localhost:5173/node_modules/.vite/deps/chunk-PQ3CTUUK.js?v=db5d3159:3161:17)
at http://localhost:5173/node_modules/.vite/deps/chunk-SWNXBIQZ.js?v=db5d3159:9627:50
at http://localhost:5173/@fs/home/slax57/workspaces/react-admin-v4/packages/ra-ui-materialui/dist/esm/input/ResettableTextField.js:36:34
at TextInput (http://localhost:5173/@fs/home/slax57/workspaces/react-admin-v4/packages/ra-ui-materialui/dist/esm/input/TextInput.js:45:25)
at div
at http://localhost:5173/node_modules/.vite/deps/chunk-SWNXBIQZ.js?v=db5d3159:9627:50
at Stack2 (http://localhost:5173/node_modules/.vite/deps/@mui_material.js?v=ac05f2e9:10738:22)
at div
at http://localhost:5173/node_modules/.vite/deps/chunk-SWNXBIQZ.js?v=db5d3159:9627:50
at CardContent2 (http://localhost:5173/node_modules/.vite/deps/chunk-Q6MUQMXH.js?v=db5d3159:79:17)
at DefaultComponent (http://localhost:5173/@fs/home/slax57/workspaces/react-admin-v4/packages/ra-ui-materialui/dist/esm/form/SimpleForm.js:103:21)
at form
@@ -722,9 +756,7 @@ Let's get back to the post list for a minute. It offers sorting and pagination, | |||
React-admin can use Input components to create a multi-criteria search engine in the list view. Pass an array of such Input components to the List `filters` prop to enable filtering: | |||
|
|||
```jsx | |||
// in src/posts.js | |||
import { ReferenceInput, TextInput, List } from 'react-admin'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why remove this import?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the import doesn't change from the previous step, and it doesn't look like that in the previous step. As is, the new import is misleading.
import { stringify } from 'query-string'; | ||
|
||
const apiUrl = 'https://my.api.com/'; | ||
const httpClient = fetchUtils.fetchJson; | ||
|
||
const dataProvider= { | ||
export const dataProvider= { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we change this to TS as well? Like declaring dataProvider
as being of type DataProvider
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, all the snippets in the tutorial are in JS.
Co-authored-by: Jean-Baptiste Kaiser <[email protected]>
You're right, back to WIP. |
Problem solved, back to RFR |
0cdb5d9
to
c792242
Compare
Co-authored-by: Aníbal Svarcas <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running the tutorial and editing a post throws a lot of this:
MUI: Too many re-renders. The layout is unstable.TextareaAutosize limits the number of renders to prevent an infinite loop.
The responsible is the body input inside the posts Edit
component
<TextInput source="body" multiline />
If you remove the multiline
prop, it works
No description provided.