You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e825c6d
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/react/getting-started.en-US.md
+15-23Lines changed: 15 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,11 +10,11 @@ Ant Design React is dedicated to providing a **good development experience** for
10
10
11
11
The official guide also assumes that you have intermediate knowledge about HTML, CSS, and JavaScript, and React. If you are just starting to learn front-end or React, it may not be the best idea to use the UI framework as your first step.
12
12
13
-
Finally, if you are working in a local development environment, please refer to [Scaffolding Guide](https://u.ant.design/guide) to create a new project.
13
+
Finally, if you are working in a local development environment, please refer to [Scaffolding Guide](/docs/react/use-with-vite) to create a new project.
14
14
15
15
---
16
16
17
-
## Your First Example
17
+
## Your First Example {#first-example}
18
18
19
19
Here is a simple online CodeSandbox demo of an Ant Design component to show the usage of Ant Design React.
20
20
@@ -23,17 +23,17 @@ Here is a simple online CodeSandbox demo of an Ant Design component to show the
23
23
24
24
Follow the steps below to play around with Ant Design yourself:
25
25
26
-
### 1. Create a CodeSandbox
26
+
### 1. Create a CodeSandbox {#create-codesandbox}
27
27
28
28
Visit https://u.ant.design/reproduce to create a CodeSandbox -- don't forget to press the save button as well to create a new instance.
29
29
30
-
### 2. Use and modify an antd component
30
+
### 2. Use and modify an antd component {#use-antd-component}
31
31
32
32
If you are working in a local React project, install `antd` first. The CodeSandbox created above already includes this dependency.
Then replace the contents of your application's entry file (for example, `src/index.js`) with the following code. As you can see, there is no difference between antd's components and typical React components.
36
+
Then replace the contents of your application's entry file (for example, `src/main.jsx`) with the following code. As you can see, there is no difference between antd's components and typical React components.
### 3. Explore more components {#explore-components}
67
67
68
68
You can view the list of components in the side menu of the Components page, such as the [Alert](/components/alert) component. Plenty of examples are also provided in the component pages and API documentation as well.
69
69
70
-
Click the "Open in Editor" icon in the first example to open an editor with source code to use out-of-the-box. Now you can import the `Alert` component into the CodeSandbox:
70
+
Click the "Show Code" icon in the first example to expand the source code. Then import the `Alert` component into the previous CodeSandbox:
71
71
72
72
```diff
73
73
- import { DatePicker, message } from 'antd';
74
74
+ import { DatePicker, message, Alert } from 'antd';
75
75
```
76
76
77
-
Now add the following jsx inside the `render` function.
77
+
Now add the following JSX inside the `App` component.
OK! Now that you know the basics of using antd components, you are welcome to explore more components in the CodeSandbox. When reporting a bug with ant design, we also strongly recommend using CodeSandbox to provide a reproducible demo as well.
91
+
OK! Now that you know the basics of using antd components, you are welcome to explore more components in the CodeSandbox. When reporting a bug with Ant Design, we also strongly recommend using CodeSandbox to provide a reproducible demo as well.
92
92
93
-
### 4. Next Steps
93
+
### 4. Next Steps {#next-steps}
94
94
95
95
During actual real-world project development, you will most likely need a development workflow consisting of `compile/build/deploy/lint/debug/` deployment. You can read the following documents on the subject or use the following scaffolds and examples provided below:
- More scaffolds at [Scaffold Market](https://scaffold.ant.design/)
100
100
101
-
## Test with Jest
102
-
103
-
Jest does not support `esm` modules, and Ant Design uses them. In order to test your Ant Design application with Jest you have to add the following to your Jest config :
`antd` supports tree shaking of ES modules, so using `import { Button } from 'antd';` would drop js code you didn't use.
112
104
113
-
## Customize your Workflow
105
+
## Customize your Workflow {#customize-workflow}
114
106
115
-
If you want to customize your workflow, we recommend using [webpack](https://webpack.js.org) or [vite](https://vite.dev/) to build and debug code. You can try out plenty of [boilerplates](https://github.com/enaqx/awesome-react#react-tools) available in the React ecosystem.
107
+
If you want to customize your workflow, we recommend using [webpack](https://webpack.js.org) or [Vite](https://vite.dev/) to build and debug code. You can try out plenty of [boilerplates](https://github.com/enaqx/awesome-react#react-tools) available in the React ecosystem.
116
108
117
109
There are also some [scaffolds](https://scaffold.ant.design/) which have already been integrated into antd, so you can try and start with one of these and even contribute.
0 commit comments