Skip to content

Commit

Permalink
update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
kimxogus committed Jul 28, 2018
1 parent a511ce6 commit ec3cad4
Show file tree
Hide file tree
Showing 42 changed files with 6,232 additions and 4,393 deletions.
2 changes: 1 addition & 1 deletion packages/react-native-version-check-expo/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ yarn.lock
.travis.yml
.git*
.yarnclean
packages/*/example/
example/
**/__tests__
63 changes: 0 additions & 63 deletions packages/react-native-version-check-expo/example/.flowconfig

This file was deleted.

18 changes: 16 additions & 2 deletions packages/react-native-version-check-expo/example/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
node_modules/
# See https://help.github.com/ignore-files/ for more about ignoring files.

# expo
.expo/
npm-debug.*

# dependencies
/node_modules

# misc
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
27 changes: 4 additions & 23 deletions packages/react-native-version-check-expo/example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Below you'll find information about performing common tasks. The most recent ver
* [Writing and Running Tests](#writing-and-running-tests)
* [Environment Variables](#environment-variables)
* [Configuring Packager IP Address](#configuring-packager-ip-address)
* [Adding Flow](#adding-flow)
* [Customizing App Display Name and Icon](#customizing-app-display-name-and-icon)
* [Sharing and Deployment](#sharing-and-deployment)
* [Publishing to Expo's React Native Community](#publishing-to-expos-react-native-community)
Expand Down Expand Up @@ -48,9 +47,9 @@ Open it in the [Expo app](https://expo.io) on your phone to view it. It will rel
Sometimes you may need to reset or clear the React Native packager's cache. To do so, you can pass the `--reset-cache` flag to the start script:

```
npm start -- --reset-cache
npm start --reset-cache
# or
yarn start -- --reset-cache
yarn start --reset-cache
```

#### `npm test`
Expand Down Expand Up @@ -92,7 +91,7 @@ To set an app icon, set the `expo.icon` key in `app.json` to be either a local p

## Writing and Running Tests

This project is set up to use [jest](https://facebook.github.io/jest/) for tests. You can configure whatever testing strategy you like, but jest works out of the box. Create test files in directories called `__tests__` or with the `.test` extension to have the files loaded by jest. See the [the template project](https://github.com/react-community/create-react-native-app/blob/master/react-native-scripts/template/App.test.js) for an example test. The [jest documentation](https://facebook.github.io/jest/docs/getting-started.html) is also a wonderful resource, as is the [React Native testing tutorial](https://facebook.github.io/jest/docs/tutorial-react-native.html).
This project is set up to use [jest](https://facebook.github.io/jest/) for tests. You can configure whatever testing strategy you like, but jest works out of the box. Create test files in directories called `__tests__` or with the `.test` extension to have the files loaded by jest. See the [the template project](https://github.com/react-community/create-react-native-app/blob/master/react-native-scripts/template/App.test.js) for an example test. The [jest documentation](https://facebook.github.io/jest/docs/en/getting-started.html) is also a wonderful resource, as is the [React Native testing tutorial](https://facebook.github.io/jest/docs/en/tutorial-react-native.html).

## Environment Variables

Expand Down Expand Up @@ -124,24 +123,6 @@ npm start

The above example would cause the development server to listen on `exp://my-custom-ip-address-or-hostname:19000`.

## Adding Flow

Flow is a static type checker that helps you write code with fewer bugs. Check out this [introduction to using static types in JavaScript](https://medium.com/@preethikasireddy/why-use-static-types-in-javascript-part-1-8382da1e0adb) if you are new to this concept.

React Native works with [Flow](http://flowtype.org/) out of the box, as long as your Flow version matches the one used in the version of React Native.

To add a local dependency to the correct Flow version to a Create React Native App project, follow these steps:

1. Find the Flow `[version]` at the bottom of the included [.flowconfig](.flowconfig)
2. Run `npm install --save-dev [email protected]` (or `yarn add --dev [email protected]`), where `x.y.z` is the .flowconfig version number.
3. Add `"flow": "flow"` to the `scripts` section of your `package.json`.
4. Add `// @flow` to any files you want to type check (for example, to `App.js`).

Now you can run `npm run flow` (or `yarn flow`) to check the files for type errors.
You can optionally use a [plugin for your IDE or editor](https://flow.org/en/docs/editors/) for a better integrated experience.

To learn more about Flow, check out [its documentation](https://flow.org/).

## Sharing and Deployment

Create React Native App does a lot of work to make app setup and development simple and straightforward, but it's very difficult to do the same for deploying to Apple's App Store or Google's Play Store without relying on a hosted service.
Expand Down Expand Up @@ -197,7 +178,7 @@ http://192.168.0.1:19001

If this works, but you're still unable to load your app by scanning the QR code, please open an issue on the [Create React Native App repository](https://github.com/react-community/create-react-native-app) with details about these steps and any other error messages you may have received.

If you're not able to load the `http` URL in your phone's web browser, try using the tethering/mobile hotspot feature on your phone (beware of data usage, though), connecting your computer to that WiFi network, and restarting the packager.
If you're not able to load the `http` URL in your phone's web browser, try using the tethering/mobile hotspot feature on your phone (beware of data usage, though), connecting your computer to that WiFi network, and restarting the packager. If you are using a VPN you may need to disable it.

### iOS Simulator won't open

Expand Down
2 changes: 1 addition & 1 deletion packages/react-native-version-check-expo/example/app.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"expo": {
"sdkVersion": "20.0.0"
"sdkVersion": "27.0.0"
}
}

This file was deleted.

Loading

0 comments on commit ec3cad4

Please sign in to comment.