Skip to content

Commit 8aeeb86

Browse files
committed
1011820: Need to include the UG section to render the Spreadsheet in different React Environments.
1 parent aa03070 commit 8aeeb86

6 files changed

Lines changed: 519 additions & 134 deletions

File tree

Document-Processing-toc.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5223,8 +5223,11 @@
52235223
<li><a href="/document-processing/excel/spreadsheet/react/data-binding">Data Binding</a></li>
52245224
<li>Environment Integration
52255225
<ul>
5226-
<li><a href="/document-processing/excel/spreadsheet/react/environment-integration/nextjs-getting-started">Next JS</a></li>
5227-
<li><a href="/document-processing/excel/spreadsheet/react/environment-integration/preact-getting-started">Preact</a></li>
5226+
<li><a href="/document-processing/excel/spreadsheet/react/environment-integration/nextjs-getting-started">Using with NextJS</a></li>
5227+
<li><a href="/document-processing/excel/spreadsheet/react/environment-integration/create-react-app">Using with Create React App</a></li>
5228+
<li><a href="/document-processing/excel/spreadsheet/react/environment-integration/preact">Using with Preact</a></li>
5229+
<li><a href="/document-processing/excel/spreadsheet/react/environment-integration/remix">Using with Remix</a></li>
5230+
<li><a href="/document-processing/excel/spreadsheet/react/environment-integration/sharepoint">Using with SharePoint Framework (SPFx)</a></li>
52285231
</ul>
52295232
</li>
52305233
<li><a href="/document-processing/excel/spreadsheet/react/open-excel-files">Open Excel Files</a>
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
---
2+
layout: post
3+
title: React Spreadsheet getting started with Create React App | Syncfusion
4+
description: Integrate and use the Syncfusion React Spreadsheet component using create react app.
5+
control: Spreadsheet
6+
platform: document-processing
7+
documentation: ug
8+
---
9+
10+
# Getting Started with Syncfusion Spreadsheet using Create React App
11+
12+
This article provides a step-by-step guide for setting up a React application using Create React App and integrating Syncfusion Spreadsheet.
13+
14+
## Prerequisites
15+
16+
Ensure the following requirements are met before starting:
17+
[System requirements for Syncfusion React Spreadsheet](https://ej2.syncfusion.com/react/documentation/system-requirement)
18+
19+
## Create the React application
20+
21+
The recommended approach is to use the [`Create React App`](https://github.com/facebook/create-react-app) tool for initializing your project. This tool sets up a development environment and optimizes the build for production.
22+
23+
To create a new application using JavaScript:
24+
25+
```
26+
npx create-react-app my-app
27+
cd my-app
28+
```
29+
30+
or
31+
32+
```
33+
yarn create react-app my-app
34+
cd my-app
35+
```
36+
37+
To create a React application in `TypeScript` environment, run the following command:
38+
39+
```
40+
npx create-react-app my-app --template typescript
41+
cd my-app
42+
```
43+
44+
Besides using the [npx](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) package runner tool, also create an application from the `npm init`. To begin with the `npm init`, upgrade the `npm` version to `npm 6`+.
45+
46+
```
47+
npm init react-app my-app
48+
cd my-app
49+
```
50+
51+
After running the above commands, the project will be created and all required dependencies will be installed automatically.
52+
53+
## Install Syncfusion React Spreadsheet Packages
54+
55+
To install the React Spreadsheet package, use the following command:
56+
57+
```
58+
npm install @syncfusion/ej2-react-spreadsheet --save
59+
```
60+
or
61+
62+
```
63+
yarn add @syncfusion/ej2-react-grids
64+
```
65+
66+
## Import CSS
67+
68+
Syncfusion React Spreadshet come with built-in [themes](https://ej2.syncfusion.com/react/documentation/appearance/theme). Import the CSS styles for the Srpeadsheet component and its dependent components in the `src/App.css` file. The example below demonstrates importing the `Tailwind 3` theme.
69+
70+
```css
71+
@import '../node_modules/@syncfusion/ej2-base/styles/tailwind3.css';
72+
@import '../node_modules/@syncfusion/ej2-inputs/styles/tailwind3.css';
73+
@import '../node_modules/@syncfusion/ej2-buttons/styles/tailwind3.css';
74+
@import '../node_modules/@syncfusion/ej2-splitbuttons/styles/tailwind3.css';
75+
@import '../node_modules/@syncfusion/ej2-lists/styles/tailwind3.css';
76+
@import '../node_modules/@syncfusion/ej2-navigations/styles/tailwind3.css';
77+
@import '../node_modules/@syncfusion/ej2-popups/styles/tailwind3.css';
78+
@import '../node_modules/@syncfusion/ej2-dropdowns/styles/tailwind3.css';
79+
@import '../node_modules/@syncfusion/ej2-grids/styles/tailwind3.css';
80+
@import '../node_modules/@syncfusion/ej2-react-spreadsheet/styles/tailwind3.css';
81+
```
82+
83+
For more details on built-in themes and usage, refer to the [Themes topic](https://ej2.syncfusion.com/react/documentation/appearance/theme).
84+
85+
## Adding Spreadsheet component
86+
87+
Now, you can import the spreadsheet component into your `src/App.jsx` file.
88+
89+
{% tabs %}
90+
{% highlight js tabtitle="app.jsx" %}
91+
import * as React from 'react';
92+
import { SpreadsheetComponent } from '@syncfusion/ej2-react-spreadsheet';
93+
import './App.css';
94+
export default function App() {
95+
return (<SpreadsheetComponent/>);
96+
}
97+
{% endhighlight %}
98+
{% highlight ts tabtitle="app.tsx" %}
99+
import * as React from 'react';
100+
import { SpreadsheetComponent } from '@syncfusion/ej2-react-spreadsheet';
101+
import './App.css';
102+
export default function App() {
103+
return (<SpreadsheetComponent/>);
104+
}
105+
{% endhighlight %}
106+
{% endtabs %}
107+
108+
## Run the application
109+
Run the app using the following commands:
110+
111+
```
112+
npm start
113+
```
114+
115+
or
116+
117+
```
118+
yarn start
119+
```
120+
121+
## See Also
122+
* [Getting Started with Syncfusion React Spreadsheet](https://help.syncfusion.com/document-processing/excel/spreadsheet/react/getting-started)

Document-Processing/Excel/Spreadsheet/React/Environment Integrations/preact-getting-started.md

Lines changed: 0 additions & 132 deletions
This file was deleted.

0 commit comments

Comments
 (0)