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] Fix react-admin's vite tutorial CSS setup #8415

Merged
merged 1 commit into from
Nov 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions docs/Tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,13 @@ const App = () => <Admin dataProvider={dataProvider} />;
export default App;
```

Also, remove the default Vite CSS fom the `main.tsx` file:
Also, change the default Vite CSS file to look like this:

```diff
// in src/main.tsx
import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App'
-import './index.css'

ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
<React.StrictMode>
<App />
</React.StrictMode>
)
// in src/index.css
Copy link
Contributor Author

@WiXSL WiXSL Nov 21, 2022

Choose a reason for hiding this comment

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

There are two more differences between simple project's index.html (which uses vite) and this tutorial's index.html

1- Script to adds the Roboto font
2- <script>window.global = window</script>

I don't know how relevant these are for a tutorial, let me know if I should add them as part of the tutorial to this PR

body {
margin: 0;
}
```

That's enough for react-admin to render an empty app and confirm that the setup is done:
Expand Down