Skip to content

Commit

Permalink
Merge pull request #3657 from nainardev/patch-1
Browse files Browse the repository at this point in the history
add correct language for code blocks
  • Loading branch information
aksonov authored Jul 13, 2020
2 parents 8113387 + 90954dc commit 25ff2ea
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
1. Install native dependencies used by React Native Router (https://reactnavigation.org/docs/en/getting-started.html)
2. Install this component

```
```sh
yarn add react-native-router-flux
```

Expand All @@ -42,7 +42,7 @@ yarn add react-native-router-flux

Define all your routes in one React component...

```js
```jsx
const App = () => (
<Router>
<Stack key="root">
Expand All @@ -56,7 +56,7 @@ const App = () => (

...and navigate from one scene to another scene with a simple and powerful API.

```js
```jsx
// Login.js

// navigate to 'home' as defined in your top-level router
Expand All @@ -77,7 +77,7 @@ For a full listing of the API, [view the API docs](https://github.com/aksonov/re

![rnrf](https://user-images.githubusercontent.com/3681859/27937441-ef61d932-626b-11e7-885f-1db7dc74b32e.gif)

```bash
```sh
# Get the code
git clone https://github.com/aksonov/react-native-router-flux.git
cd react-native-router-flux/examples/[expo|react-native|redux]
Expand Down Expand Up @@ -120,19 +120,19 @@ yarn start

- If you have a Scene where in you want to make some changes to your Component State when Back button is pressed, then doing this

```js
```jsx
<Scene key={...} component={...} onBack={()=>{/*code*/}}/>
```

will not help.

```js
```jsx
<Scene key={...} component={...} onBack={()=>{/*code*/}} back={true}/>
```

Make sure back = true is passed to your scene, now in your Component's lifecycle add this

```js
```jsx
componentDidMount(){
InteractionManager.runAfterInteractions(()=> {
Actions.refresh({onBack:()=>this.changeSomethingInYourComponent()})
Expand Down

0 comments on commit 25ff2ea

Please sign in to comment.