Skip to content

Commit 3e2d186

Browse files
committed
add warning
1 parent e9e74bc commit 3e2d186

File tree

3 files changed

+37
-5
lines changed

3 files changed

+37
-5
lines changed

.eslintignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/dist
2+
/node_modules

README.md

+33-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,33 @@
1-
# React-Google-Apps-Script
2-
# React-Google-Apps-Script
1+
#React + Google Apps Script
2+
3+
Use this repo as your boilerplate React app for use with Google Apps Script html dialogs.
4+
5+
It uses labnol's excellent [apps-script-starter](https://github.com/labnol/apps-script-starter) project as a starting point, but adds support for client-side dialogs built with React, and shows how React pages can interact with Google Apps server-side script.
6+
7+
**Installation**
8+
9+
Set up the sample project:
10+
```
11+
mkdir my-gas-react-app && cd my-gas-react-app
12+
clone https://github.com/enuchi/React-Google-Apps-Script.git
13+
npm install
14+
```
15+
Create a new Google Sheets spreadsheet. Open the Script Editor (Tools --> Script Editor) and copy the ScriptId (File --> Project properties).
16+
17+
Add the ScriptId to the .clasp.json file:
18+
```
19+
// .clasp.json
20+
{
21+
"rootDir": "dist",
22+
"scriptId":"...paste scriptId here..."
23+
}
24+
```
25+
Log into CLASP, which lets you develop Apps Script projects locally, and follow the authorization flow:
26+
```
27+
npx clasp login
28+
```
29+
Build and deploy the app!
30+
```
31+
npm run build
32+
npm run deploy
33+
```

src/index.jsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import React from "react";
22
import ReactDOM from "react-dom";
3-
import ReactCSSTransitionGroup from 'react-addons-css-transition-group';
4-
3+
import ReactCSSTransitionGroup from 'react-addons-css-transition-group';
54
import css from "./styles.css";
65

7-
86
class FormInput extends React.Component {
97
constructor(props) {
108
super(props);
@@ -75,6 +73,7 @@ class SheetEditor extends React.Component {
7573
return (
7674
<div>
7775
<FormInput newSheetFormHandler={this.newSheetFormHandler}/>
76+
<span>Clicking on the X will delete the respective sheet. This cannot be undoed. It is recommended you use this sample tool on a new, empty Spreadsheet.</span>
7877
<ReactCSSTransitionGroup
7978
transitionName="sheetNames"
8079
transitionAppear={true}

0 commit comments

Comments
 (0)