From 6757bc4d9d6a474166ff59867f77998969895304 Mon Sep 17 00:00:00 2001 From: Website Deployment Script Date: Fri, 7 Apr 2017 18:30:46 +0000 Subject: [PATCH] Updated docs for next --- releases/next/docs/integration-with-existing-apps.html | 2 +- releases/next/docs/scrollview.html | 2 +- releases/next/docs/upgrading.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/releases/next/docs/integration-with-existing-apps.html b/releases/next/docs/integration-with-existing-apps.html index 62ea19ade30..0e4392c00a4 100644 --- a/releases/next/docs/integration-with-existing-apps.html +++ b/releases/next/docs/integration-with-existing-apps.html @@ -364,7 +364,7 @@ public boolean onKeyUpreturn true; } return super.onKeyUp(keyCode, event); -}

Now your activity is ready to run some JavaScript code.

Configure permissions for development error overlay #

If your app is targeting the Android API level 23 or greater, make sure you have the overlay permission enabled for the development build. You can check it with Settings.canDrawOverlays(this);. This is required in dev builds because react native development errors must be displayed above all the other windows. Due to the new permissions system introduced in the API level 23, the user needs to approve it. This can be acheived by adding the following code to the Activity file in the onCreate() method. OVERLAY_PERMISSION_REQ_CODE is a field of the class which would be responsible for passing the result back to the Activity.

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { +}

Now your activity is ready to run some JavaScript code.

Configure permissions for development error overlay #

If your app is targeting the Android API level 23 or greater, make sure you have the overlay permission enabled for the development build. You can check it with Settings.canDrawOverlays(this);. This is required in dev builds because react native development errors must be displayed above all the other windows. Due to the new permissions system introduced in the API level 23, the user needs to approve it. This can be achieved by adding the following code to the Activity file in the onCreate() method. OVERLAY_PERMISSION_REQ_CODE is a field of the class which would be responsible for passing the result back to the Activity.

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { if (!Settings.canDrawOverlays(this)) { Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION, Uri.parse("package:" + getPackageName())); diff --git a/releases/next/docs/scrollview.html b/releases/next/docs/scrollview.html index 95f6fc5a70b..6c521affb7f 100644 --- a/releases/next/docs/scrollview.html +++ b/releases/next/docs/scrollview.html @@ -9,7 +9,7 @@ easy to debug.

Doesn't yet support other contained responders from bl view from becoming the responder.

<ScrollView> vs <FlatList> - which one to use?

ScrollView simply renders all its react child components at once. That makes it very easy to understand and use.

On the other hand, this has a performance downside. Imagine you have a very long list of items you want to display, maybe several screens worth of -content. Creating JS components and native views for everythign all at once, +content. Creating JS components and native views for everything all at once, much of which may not even be shown, will contribute to slow rendering and increased memory usage.

This is where FlatList comes into play. FlatList renders items lazily, just when they are about to appear, and removes items that scroll way off diff --git a/releases/next/docs/upgrading.html b/releases/next/docs/upgrading.html index fca8e8c4d7a..27be831dc93 100644 --- a/releases/next/docs/upgrading.html +++ b/releases/next/docs/upgrading.html @@ -3,7 +3,7 @@ and other goodies. Because React Native projects are essentially made up of an A iOS project and a JavaScript project, all combined under an npm package, upgrading can be rather tricky. But we try to make it easy for you. Here's what you need to do to upgrade from an older version of React Native:

Upgrade based on Git #

IMPORTANT: You don't have to install the new version of React Native, it will be installed automatically.

The module react-native-git-upgrade provides a one-step operation to upgrade the source files with -a minimum of conflicts. Under the hood, it consists in 2 phases:

  • First, it computes a Git patch between both old and new template files,
  • Then, the patch is applied on the user's sources.

1. Install Git #

Your project doesn't have to be handled by the Git versioning sytem (could be Mercurial, SVN or none) +a minimum of conflicts. Under the hood, it consists in 2 phases:

  • First, it computes a Git patch between both old and new template files,
  • Then, the patch is applied on the user's sources.

1. Install Git #

Your project doesn't have to be handled by the Git versioning system (could be Mercurial, SVN or none) but Git has to be installed and available in the PATH. You can download Git here: https://git-scm.com/downloads

2. Install the react-native-git-upgrade module #

It's a CLI tool and must be installed globally:

$ npm install -g react-native-git-upgrade

3. Run the command #

Run the command to start the process:

$ react-native-git-upgrade # Upgrade React Native to the latest version