mirror of
https://github.com/zhigang1992/examples.git
synced 2026-04-28 17:36:00 +08:00
Merge pull request #173 from expo/@evanbacon/blank/init
Created blank example
This commit is contained in:
16
blank/App.js
Normal file
16
blank/App.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import * as React from "react";
|
||||
import { View, Text } from "react-native";
|
||||
|
||||
export default function App() {
|
||||
return (
|
||||
<View
|
||||
style={{
|
||||
flex: 1,
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
}}
|
||||
>
|
||||
<Text>Universal React with Expo</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
44
blank/README.md
Normal file
44
blank/README.md
Normal file
@@ -0,0 +1,44 @@
|
||||
# My Universal React Project
|
||||
|
||||
<p>
|
||||
<!-- iOS -->
|
||||
<a href="https://itunes.apple.com/app/apple-store/id982107779">
|
||||
<img alt="Supports Expo iOS" longdesc="Supports Expo iOS" src="https://img.shields.io/badge/iOS-4630EB.svg?style=flat-square&logo=APPLE&labelColor=999999&logoColor=fff" />
|
||||
</a>
|
||||
<!-- Android -->
|
||||
<a href="https://play.google.com/store/apps/details?id=host.exp.exponent&referrer=blankexample">
|
||||
<img alt="Supports Expo Android" longdesc="Supports Expo Android" src="https://img.shields.io/badge/Android-4630EB.svg?style=flat-square&logo=ANDROID&labelColor=A4C639&logoColor=fff" />
|
||||
</a>
|
||||
<!-- Web -->
|
||||
<a href="https://docs.expo.io/workflow/web/">
|
||||
<img alt="Supports Expo Web" longdesc="Supports Expo Web" src="https://img.shields.io/badge/web-4630EB.svg?style=flat-square&logo=GOOGLE-CHROME&labelColor=4285F4&logoColor=fff" />
|
||||
</a>
|
||||
</p>
|
||||
|
||||
## 🚀 How to use
|
||||
|
||||
- Install packages with `yarn` or `npm install`.
|
||||
- If you have native iOS code run `npx pod-install`
|
||||
- Run `yarn start` to start the bundler.
|
||||
- Open the project in a React runtime to try it:
|
||||
- iOS: [Client iOS](https://itunes.apple.com/app/apple-store/id982107779)
|
||||
- Android: [Client Android](https://play.google.com/store/apps/details?id=host.exp.exponent&referrer=blankexample)
|
||||
- Web: Any web browser
|
||||
|
||||
## Adding Native Code
|
||||
|
||||
This project can be run from a web browser or the Expo client app. You may find that you want to add more native code later on. You can do this by ejecting the project and rebuilding it yourself.
|
||||
|
||||
- Run `yarn eject` to create the native projects.
|
||||
- You can still run your project in the web browser or Expo client, you just won't be able to access any new native modules you add.
|
||||
|
||||
## Publishing
|
||||
|
||||
- Deploy the native app to the App store and Play store using this guide: [Deployment](https://docs.expo.io/distribution/app-stores/).
|
||||
- Deploy the website using this guide: [Web deployment](https://docs.expo.io/distribution/publishing-websites/).
|
||||
|
||||
## 📝 Notes
|
||||
|
||||
- Learn more about [Universal React](https://docs.expo.io/).
|
||||
- See what API and components are [available in the React runtimes](https://docs.expo.io/versions/latest/).
|
||||
- Find out more about developing apps and websites: [Guides](https://docs.expo.io/guides/).
|
||||
6
blank/babel.config.js
Normal file
6
blank/babel.config.js
Normal file
@@ -0,0 +1,6 @@
|
||||
module.exports = function(api) {
|
||||
api.cache(true);
|
||||
return {
|
||||
presets: ['babel-preset-expo'],
|
||||
};
|
||||
};
|
||||
12
blank/package.json
Normal file
12
blank/package.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"expo": "37.0.11",
|
||||
"react": "16.9.0",
|
||||
"react-dom": "16.9.0",
|
||||
"react-native": "https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz",
|
||||
"react-native-web": "0.11.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "7.9.0"
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,8 @@ Thanks for contributing! 😁 Here are some rules that will make your example la
|
||||
|
||||
## Rules
|
||||
|
||||
- It's important to keep examples **concise**.
|
||||
- It's important to keep examples **concise**.
|
||||
- Start with the [blank example](./blank).
|
||||
- We use a unified [`.gitignore`](./.gitignore)
|
||||
- No `package.json` or `app.config.js` values that aren't completely necessary
|
||||
- Use the new `app.config.js` instead of `app.json`
|
||||
|
||||
Reference in New Issue
Block a user