0.36: Headless JS, the Keyboard API, & more

  • Working with the on-screen keyboard is now easier with Keyboard .
  • import { Keyboard } from ‘react-native’ // Hide that keyboard!
  • There are some cases where an animated value needs to invert another animated value for calculation.
  • With version 0.36, combining two animated values via division is now possible.
  • b will then follow a ‘s spring animation and produce the value of 1 / a .

Headless JS is a way to run tasks in JavaScript while your app is in the background. It can be used, for example, to sync fresh data, handle push notifications, or play music. It is only available on Android, for now.

@reactnative: React Native 0.36 is out! Headless JS tasks on Android, a Keyboard API, & more

Today we are releasing React Native 0.36. Read on to learn more about what’s new.

Headless JS is a way to run tasks in JavaScript while your app is in the background. It can be used, for example, to sync fresh data, handle push notifications, or play music. It is only available on Android, for now.

AppRegistry. registerHeadlessTask( ‘SomeTaskName’ , ( ) = > require( ‘SomeTaskName’ ) ) ;

Using Headless JS does require some native Java code to be written in order to allow you to start up the service when needed. Take a look at our new Headless JS docs to learn more!

import { Keyboard } from ‘react-native’ // Hide that keyboard! Keyboard. dismiss( )

Combining two animated values via addition, multiplication, and modulo are already supported by React Native. With version 0.36, combining two animated values via division is now possible. There are some cases where an animated value needs to invert another animated value for calculation. An example is inverting a scale (2x –> 0.5x):

The basic usage is like this:

In this example, the inner image won’t get stretched at all because the parent’s scaling gets cancelled out. If you’d like to learn more, check out the Animations guide.

on both iOS and Android. The behavior will now be the following:

The above is just a sample of what has changed in 0.36. Check out the release notes on GitHub to see the full list of new features, bug fixes, and breaking changes.

You can upgrade to 0.36 by running the following commands in a terminal:

0.36: Headless JS, the Keyboard API, & more