Skip to content
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

Merged
merged 6 commits into from
Nov 8, 2022

Conversation

fzaninotto
Copy link
Member

No description provided.

Copy link
Contributor

@slax57 slax57 left a 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

docs/Tutorial.md Outdated Show resolved Hide resolved
@@ -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';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why remove this import?

Copy link
Member Author

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= {
Copy link
Contributor

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?

Copy link
Member Author

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.

docs/Tutorial.md Show resolved Hide resolved
fzaninotto and others added 2 commits November 4, 2022 11:10
Co-authored-by: Jean-Baptiste Kaiser <jb@marmelab.com>
@fzaninotto
Copy link
Member Author

One last thing, I have the following error when running the tutorial locally and browsing to PostEdit:

You're right, back to WIP.

@fzaninotto fzaninotto added RFR Ready For Review and removed WIP Work In Progress labels Nov 4, 2022
@fzaninotto
Copy link
Member Author

Problem solved, back to RFR

docs/Tutorial.md Outdated Show resolved Hide resolved
docs/Tutorial.md Outdated Show resolved Hide resolved
docs/Tutorial.md Outdated Show resolved Hide resolved
docs/Tutorial.md Show resolved Hide resolved
docs/Tutorial.md Outdated Show resolved Hide resolved
docs/Tutorial.md Outdated Show resolved Hide resolved
Co-authored-by: Aníbal Svarcas <WiXSL@users.noreply.github.com>
Copy link
Contributor

@WiXSL WiXSL left a 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

@fzaninotto fzaninotto merged commit 202274e into master Nov 8, 2022
@fzaninotto fzaninotto deleted the tutorial-vite branch November 8, 2022 15:03
@fzaninotto fzaninotto added this to the 4.5.1 milestone Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants