[ci skip] Updated React and React Native demos (#1998)

This commit is contained in:
Garrett Luu 2020-06-11 16:20:51 -07:00 committed by GitHub
parent 5c1296a46d
commit 688757ac64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 35 additions and 2 deletions

@ -1,5 +1,5 @@
.PHONY: react
react: ## Simple server for react and clones
react: init ## Simple server for react and clones
python -mSimpleHTTPServer
.PHONY: next

22
demos/react/NOTES.md Normal file

@ -0,0 +1,22 @@
# Additional Notes
## Java, React Native, Gradle versions
This demo was tested and runs with React Native 0.62.2, Java 11, and Gradle
3.5.2. Running `make native` will invoke `native.sh`, which uses a fixed version
of React Native 0.62.2 to build and run the demo.
Make sure you have the correct version of Java (11) installed, since 0.62.2 might
not work with newer versions of Java.
## Common Issues
```
ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
```
Add `export JAVA_HOME=<directory>`, replacing `<directory>` with the location of
your Java install, to your `.bashrc` or any other shell that you are using.

@ -22,6 +22,10 @@ Other scripts in this demo show:
- `preact` using the react compatibility library
- `react-native` deployment for iOS and android
Run `make react` to run the browser demo for React, or run `make next` to run
the server-rendered demo using `next.js`.
## Internal State
The simplest state representation is an array of arrays. To avoid having the
@ -109,6 +113,9 @@ writeFile(file, wbout, 'ascii').then((r)=>{/* :) */}).catch((e)=>{/* :( */});
Note: for real app deployments, the `UIFileSharingEnabled` flag must be manually
set in the iOS project `Info.plist` file.
To run the React Native demo, run either `make ios` or `make android` while
connected to a device or emulator.
## Other Demos
#### Preact
@ -125,3 +132,7 @@ step adds a small header that imports the library. The import is not needed in
deployments that use script tags to include the library.
[![Analytics](https://ga-beacon.appspot.com/UA-36810333-1/SheetJS/js-xlsx?pixel)](https://github.com/SheetJS/js-xlsx)
## Additional Notes
Some additional notes can be found in [NOTES.md](NOTES.md).

@ -1,7 +1,7 @@
#!/bin/bash
# xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */
if [ ! -e SheetJS ]; then
react-native init --version="0.53.3" SheetJS
react-native init --version="0.62.2" SheetJS
cd SheetJS
npm i -S xlsx react-native-table-component react-native-fs
cd -