From 5cd1a4352ac28fd283f1395a797b8c9c02c2c29f Mon Sep 17 00:00:00 2001 From: Peter Piekarczyk Date: Fri, 15 Sep 2017 16:21:16 -0500 Subject: [PATCH] Add Syntax highlighting to Redux-Integration.md (#2355) * Add Syntax highlighting to Redux-Integration.md * Update Redux-Integration.md --- .../react-navigation/docs/guides/Redux-Integration.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/react-navigation/docs/guides/Redux-Integration.md b/packages/react-navigation/docs/guides/Redux-Integration.md index 68752cb6..1cd221ba 100644 --- a/packages/react-navigation/docs/guides/Redux-Integration.md +++ b/packages/react-navigation/docs/guides/Redux-Integration.md @@ -4,7 +4,7 @@ To handle your app's navigation state in redux, you can pass your own `navigatio With redux, your app's state is defined by a reducer. Each navigation router effectively has a reducer, called `getStateForAction`. The following is a minimal example of how you might use navigators within a redux application: -```js +```es6 import { addNavigationHelpers } from 'react-navigation'; const AppNavigator = StackNavigator(AppRouteConfigs); @@ -61,7 +61,7 @@ Navigation state is automatically passed down from one navigator to another when Applying this to the example above, you could instead define `AppNavigator` to contain a nested `TabNavigator` as follows: -```js +```es6 const AppNavigator = StackNavigator({ Home: { screen: MyTabNavigator }, }); @@ -77,7 +77,8 @@ There's a working example app with redux [here](https://github.com/react-communi To make jest tests work with your react-navigation app, you need to change the jest preset in the `package.json`, see [here](https://facebook.github.io/jest/docs/tutorial-react-native.html#transformignorepatterns-customization): -```JSON + +```json "jest": { "preset": "react-native", "transformIgnorePatterns": [ @@ -90,7 +91,7 @@ To make jest tests work with your react-navigation app, you need to change the j By using the following snippet, your nav component will be aware of the back button press actions and will correctly interact with your stack. This is really useful on Android. -```js +```es6 import React from "react"; import { BackHandler } from "react-native"; import { addNavigationHelpers, NavigationActions } from "react-navigation";