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
Make sure you have [node](https://nodejs.org/)and [yarn](https://yarnpkg.com/cli/install)installed. `node 14.4.0` and `yarn 1.22.4` are used in the example below.
17
+
Make sure you have [node](https://nodejs.org/) installed. `node 20.18.2` is used in the example below.
18
18
19
19
## Create the Sample Project
20
20
21
-
### Create a Bootstrapped Raw React Application
21
+
### Create a React project using Vite:
22
22
23
23
```cmd
24
-
npx create-react-app dwt-react
24
+
npm create vite@latest dwt-react --template react
25
25
```
26
26
27
-
### **cd** to the root directory of the application and install the `dwt` and `ncp` package
27
+
After running this, you will need to select the following options:
28
+
- Select a framework: React
29
+
- Select a variant: JavaScript
30
+
31
+
### Navigate to the project folder:
32
+
33
+
```cmd
34
+
cd dwt-react
35
+
```
36
+
37
+
### Install dependencies and the required packages for DWT and NCP:
28
38
29
39
```cmd
30
-
yarn add dwt
40
+
npm install
31
41
```
32
42
33
43
```cmd
34
-
yarn add ncp
44
+
npm install dwt ncp
35
45
```
36
46
37
47
> `ncp` is used to copy static resources files.
@@ -42,10 +52,11 @@ Open `package.json` and change `scripts` like this:
> *`ProductKey` must be set to a valid trial or full key.
120
129
> *`ResourcesPath` points to the location of the static files mentioned in [Configure the project](#configure-the-project).
121
130
122
-
### Add the Component to `App.js`
131
+
### Add the Component to `App.jsx`
123
132
124
133
```javascript
125
134
importReactfrom'react';
126
135
import'./App.css';
127
136
importDWTfrom'./dwt';
128
137
129
138
functionApp() {
130
-
return( <DWT/> );
139
+
return<DWT/>;
131
140
}
132
141
133
142
exportdefaultApp;
134
143
```
135
144
145
+
### remove default styles
146
+
Clear the contents of the src/App.css and src/index.css files.
147
+
136
148
### Run the Application
137
149
138
150
```cmd
139
-
yarn start
151
+
npm run dev
140
152
```
141
153
142
154
> Note: If you have installed `DWT` and have configured a valid `ProductKey`, you will have a working page to scan documents from your scanner now. Otherwise, you should see instructions on the page that guide you to install the library. [More info>>]({{site.indepth}}features/initialize.html#installation-of-the-dynamsoft-service)
0 commit comments