Skip to content

Commit 26e1257

Browse files
committed
build: renamed package
1 parent f193136 commit 26e1257

File tree

5 files changed

+21
-17
lines changed

5 files changed

+21
-17
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Remember to add tests for your change if possible. Run the unit tests by:
4949
yarn test
5050
```
5151

52-
To edit the Objective-C files, open `example/ios/AppStateAwareFocusEffectExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > react-native-app-state-aware-focus-effect`.
52+
To edit the Objective-C files, open `example/ios/AppStateAwareFocusEffectExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > react-navigation-app-state-aware-focus-effect`.
5353

5454
To edit the Kotlin files, open `example/android` in Android studio and find the source files at `reactnativeappstateawarefocuseffect` under `Android`.
5555

README.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# react-native-app-state-aware-focus-effect
1+
# react-navigation-app-state-aware-focus-effect
22

3-
[![linmic](https://circleci.com/gh/linmic/react-native-app-state-aware-focus-effect.svg?style=shield)](https://app.circleci.com/pipelines/github/linmic/react-native-app-state-aware-focus-effect)
3+
[![linmic](https://circleci.com/gh/linmic/react-navigation-app-state-aware-focus-effect.svg?style=shield)](https://app.circleci.com/pipelines/github/linmic/react-navigation-app-state-aware-focus-effect)
44

55
AppState-aware focus effect for React Native with React Navigation
66

@@ -13,23 +13,25 @@ This hook could be useful for those applications that use [React Navigation](htt
1313
## Installation
1414

1515
```sh
16-
npm i react-native-app-state-aware-focus-effect # or
17-
yarn add react-native-app-state-aware-focus-effect
16+
npm i react-navigation-app-state-aware-focus-effect # or
17+
yarn add react-navigation-app-state-aware-focus-effect
1818
```
1919

2020
## Usage
2121

2222
### Minimal example
2323

2424
```js
25-
import useAppStateAwareFocusEffect from 'react-native-app-state-aware-focus-effect';
25+
import useAppStateAwareFocusEffect from 'react-navigation-app-state-aware-focus-effect';
2626

2727
const req = fetch('https://example.com/dummy.json');
2828

2929
// make sure you memoize the effect
30-
useAppStateAwareFocusEffect(useCallback(() => {
31-
req();
32-
}, []));
30+
useAppStateAwareFocusEffect(
31+
useCallback(() => {
32+
req();
33+
}, [])
34+
);
3335
```
3436

3537
### A more comprehensive example
@@ -38,7 +40,7 @@ useAppStateAwareFocusEffect(useCallback(() => {
3840
import React, { useCallback } from 'react';
3941
import { View, Text } from 'react-native';
4042
import { gql, useQuery } from '@apollo/client';
41-
import useAppStateAwareFocusEffect from 'react-native-app-state-aware-focus-effect';
43+
import useAppStateAwareFocusEffect from 'react-navigation-app-state-aware-focus-effect';
4244

4345
const GET_DOGS = gql`
4446
query GetDogs {
@@ -54,9 +56,11 @@ const Dogs = () => {
5456
fetchPolicy: 'cache-and-network',
5557
});
5658

57-
useAppStateAwareFocusEffect(useCallback(() => {
58-
refetch();
59-
}, []));
59+
useAppStateAwareFocusEffect(
60+
useCallback(() => {
61+
refetch();
62+
}, [])
63+
);
6064

6165
if (loading) return 'Loading...';
6266
if (error) return `Error! ${error.message}`;

example/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "react-native-app-state-aware-focus-effect-example",
3-
"description": "Example app for react-native-app-state-aware-focus-effect",
2+
"name": "react-navigation-app-state-aware-focus-effect-example",
3+
"description": "Example app for react-navigation-app-state-aware-focus-effect",
44
"version": "0.0.1",
55
"private": true,
66
"scripts": {

example/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { useCallback } from 'react';
22
import { StyleSheet, View, Text, Alert } from 'react-native';
33
import { NavigationContainer } from '@react-navigation/native';
44
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
5-
import useAppStateAwareFocusEffect from 'react-native-app-state-aware-focus-effect';
5+
import useAppStateAwareFocusEffect from 'react-navigation-app-state-aware-focus-effect';
66

77
function HomeScreen() {
88
const memoizedEffect = useCallback(() => {

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"compilerOptions": {
33
"baseUrl": ".",
44
"paths": {
5-
"react-native-app-state-aware-focus-effect": ["./src/index"]
5+
"react-navigation-app-state-aware-focus-effect": ["./src/index"]
66
},
77
"allowUnreachableCode": false,
88
"allowUnusedLabels": false,

0 commit comments

Comments
 (0)