GithubHelp home page GithubHelp logo

react-native-demo's Introduction

React Native Demo

Development Environment

  • Node v17.5.0
  • NPM 8.4.1
  • Yarn 1.22.17
  • CocoaPods 1.11.2
  • Xcode 13.2

Create Project

react-native init ReactNativeDemo

React Native CLI creates code structure for you, containing ios and android folder. Run pod install automaticly to resolve dependencies in iOS project.

When you want to install new components in project, firstly need to install them in node project. For example:

yarn add @react-navigation/native @react-navigation/native-stack
yarn add react-native-screens react-native-safe-area-context

For iOS with bare React Native project, make sure you have Cocoapods installed. Then install the pods to complete the installation:

cd ios
pod install
cd ..

Build Project

yarn install
cd ios
pod install
cd ..

Open ios/ReactNativeDemo.xcworkspace with Xcode. Press Command+B to build this app.

Run App for Debug

To debug the app on simulator or real device, must run up launch packager first:

yarn run start

Open ios/ReactNativeDemo.xcworkspace with Xcode. Press Command+R to run app on iPhone.

Make sure to start the simulator before start launch packager, this way the auto refresh can take effect. You can see the app screen refresh on the silulator after you change the code.

To debug the app, press Command+D on simulator to call out the developer menu. Click 'Debug with Chrome'.

Open http://localhost:8081/debugger-ui/ with Chrome. You can see the React Native Debugger on the screen. It holds a debugger session. Follow the instruments on the page, press Command+Option+I to open the developer tools.

In 'Console' tab, you can see the console.log output in the app.

In 'Sources' tab, you can setup the breakpoint and watch the local variations' value to debug the code.

You may also install the standalone version of React Developer Tools to inspect the React component hierarchy, their props, and state.

To run the app on real device, connect the Xcode to a iPhone and switch the device setting before Command+R. You can shake the device to call out the developer menu on iPhone.

react-native-demo's People

Contributors

lane-lu avatar rm-vrf avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.