Skip to content

Commit bce9013

Browse files
Upgrade to react-native 0.69.7 includes lots of other package upgrade, changes to react navigation etc.
1 parent 9296c49 commit bce9013

11 files changed

+7838
-56
lines changed

App.js

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,34 @@
1-
import { createAppContainer } from 'react-navigation';
2-
import { createStackNavigator } from 'react-navigation-stack';
1+
import 'react-native-gesture-handler';
2+
import * as React from 'react';
3+
import { View, Text } from 'react-native';
4+
import { NavigationContainer } from '@react-navigation/native';
5+
import { createStackNavigator } from '@react-navigation/stack';
6+
import { createNativeStackNavigator } from '@react-navigation/native-stack';
7+
38
import MainScreen from './MainScreen';
4-
import FlatMainScreen from './FlatMainScreen';
59
import HomeScreen from './HomeScreen';
10+
import FlatMainScreen from './FlatMainScreen';
611

7-
//if (!__DEV__ || __DEV__) {
812
if (!__DEV__) {
913
console = {};
1014
console.log = () => {};
1115
console.error = () => {};
1216
console.assert = () => {};
1317
}
14-
const MainNavigator = createStackNavigator(
15-
{ Home: HomeScreen,
16-
Main: MainScreen,
17-
FlatMain : FlatMainScreen },
18-
{ initialRouteName: 'Home' }
19-
);
2018

21-
const App = createAppContainer(MainNavigator);
19+
const Stack = createNativeStackNavigator();
20+
//const Stack = createStackNavigator();
21+
22+
function App() {
23+
return (
24+
<NavigationContainer>
25+
<Stack.Navigator>
26+
<Stack.Screen name="Home" component={HomeScreen} />
27+
<Stack.Screen name="Main" component={MainScreen} />
28+
<Stack.Screen name="FlatMain" component={FlatMainScreen} />
29+
</Stack.Navigator>
30+
</NavigationContainer>
31+
);
32+
}
2233

2334
export default App;

FlatMainScreen.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { Component } from 'react';
22
import { Dimensions } from 'react-native';
33
import styled from 'styled-components/native';
44
import NamesList from './NamesList';
5-
import {NavigationEvents} from 'react-navigation';
5+
//import {NavigationEvents} from 'react-navigation';
66
import FooterComponent from './FooterComponent';
77
import TextWrapper from './TextWrapper';
88
const windowWidth = Dimensions.get('window').width;
@@ -90,11 +90,15 @@ class FlatMainScreen extends Component {
9090
}
9191

9292
render() {
93-
const { navigation } = this.props;
94-
let data = navigation.getParam('names');
95-
let listData = navigation.getParam('listNames');
96-
let rework = navigation.getParam('rework');
97-
let mapNameIndexToLetterIndex = navigation.getParam('mapNameIndexToLetterIndex');
93+
if (!this.props?.route?.params?.names) {
94+
console.log("Returning null ..." + JSON.stringify(this.props));
95+
return null;
96+
}
97+
let data = this.props.route.params.names;
98+
let showAlpha = this.props.route.params.showAlpha;
99+
let listData = this.props.route.params.listNames;
100+
let rework = this.props.route.params.rework;
101+
let mapNameIndexToLetterIndex = this.props.route.params.mapNameIndexToLetterIndex;
98102
console.log("FFFF sending listData as sections = " + JSON.stringify(listData));
99103
let headerData = {"A":[{"id":11,"name":"Aaliyah","description":"Aaliyah"}]};
100104
/*let progressBar = null;
@@ -110,12 +114,13 @@ class FlatMainScreen extends Component {
110114
//progressBar = null;
111115
return (
112116
<FlatMainScreenWrapper onLayout={this.onLayout}>
117+
{/*
113118
<NavigationEvents
114119
onDidFocus={() => {} } // noop
115120
onWillFocus={() => { this.showProgressBar('willFocus'); } }
116121
onWillBlur={() => { this.hideProgressBar('willBlur'); } }
117122
onDidBlur={() => { this.hideProgressBar('didBlur'); } }
118-
/>
123+
/>*/}
119124
{progressBar}
120125
<ContentView
121126
size="small"
@@ -145,4 +150,4 @@ class FlatMainScreen extends Component {
145150
}
146151
}
147152

148-
export default FlatMainScreen;
153+
export default FlatMainScreen;

HomeScreen.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import styled from 'styled-components/native';
99
import myResource from './assets/yob2019.txt';
1010
import PButton from './PButton';
1111
//import ProgressBar from 'react-native-progress/Bar';
12-
import {NavigationEvents} from 'react-navigation';
1312

1413
const windowWidth = Dimensions.get('window').width;
1514
const windowHeight = Dimensions.get('window').height;
@@ -207,7 +206,6 @@ class HomeScreen extends Component {
207206
return (
208207
<HomeScreenWrapper>
209208

210-
<NavigationEvents onDidFocus={() => console.log('I am triggered')} />
211209
<View style={styles.title}>
212210
<Text style={styles.title}>There {this.state.countNames == 1 ? 'is' : 'are'} {this.state.countNames} name{this.state.countNames == 1 ? '' : 's'} in the list</Text>
213211
</View>

ListHeader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
2+
import { Button } from 'react-native';
23
import styled from 'styled-components/native';
3-
import Button from 'react-native-button';
44

55
const ListHeaderView = styled.View`
66
background-color: ${props =>

ListHeaderView.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import React from 'react';
1+
import React, { Button } from 'react';
22
import styled from 'styled-components/native';
3-
import Button from 'react-native-button';
43

54
const ListHeaderView = styled.View`
65
background-color: ${props =>

ListItem.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
2-
import { View, DeviceEventEmitter } from 'react-native';
3-
import Button from 'react-native-button';
2+
import { View, DeviceEventEmitter, Button } from 'react-native';
3+
// import Button from 'react-native-button';
44
import styled from 'styled-components/native';
55

66
const ListItemView = styled.View`
@@ -195,6 +195,7 @@ export class ListItem extends React.Component {
195195
}
196196

197197
render() {
198+
console.log("WHat are the props eh? " + JSON.stringify(this.props));
198199
return (
199200
<ListItemView
200201
pointerEvents="box-none"
@@ -214,6 +215,7 @@ export class ListItem extends React.Component {
214215
close={this.state.closeSwipe}
215216
>
216217
<ListItemButton
218+
title={this.props.name}
217219
{...this.props}
218220
disabled={
219221
this.props.disabled ||

MainScreen.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React, { Component } from 'react';
22
import { Dimensions } from 'react-native';
33
import styled from 'styled-components/native';
44
import NamesList from './NamesList';
5-
import {NavigationEvents} from 'react-navigation';
65
import FooterComponent from './FooterComponent';
76
import TextWrapper from './TextWrapper';
87
const windowWidth = Dimensions.get('window').width;
@@ -54,6 +53,7 @@ class MainScreen extends Component {
5453
/** Lifecycle methods */
5554
constructor(props) {
5655
super(props);
56+
console.log("constructor MainScreen has props: " + JSON.stringify(props));
5757
this.state = {
5858
names : {},
5959
progress : false
@@ -90,9 +90,13 @@ class MainScreen extends Component {
9090
}
9191

9292
render() {
93-
const { navigation } = this.props;
94-
let data = navigation.getParam('names');
95-
let showAlpha = navigation.getParam('showAlpha');
93+
if (!this.props?.route?.params?.names) {
94+
console.log("Returning null ..." + JSON.stringify(this.props));
95+
return null;
96+
}
97+
console.log("NOT Returning null ..." + JSON.stringify(this.props.route.params));
98+
let data = this.props.route.params.names;
99+
let showAlpha = this.props.route.params.showAlpha;
96100
let headerData = {"A":[{"id":11,"name":"Aaliyah","description":"Aaliyah"}]};
97101
let progressBar = null;
98102
if (this.state.progress) {
@@ -102,12 +106,13 @@ class MainScreen extends Component {
102106
}
103107
return (
104108
<MainScreenWrapper onLayout={this.onLayout}>
109+
{/**
105110
<NavigationEvents
106111
onDidFocus={() => {} } // noop
107112
onWillFocus={() => { this.showProgressBar('willFocus'); } }
108113
onWillBlur={() => { this.hideProgressBar('willBlur'); } }
109114
onDidBlur={() => { this.hideProgressBar('didBlur'); } }
110-
/>
115+
/> */}
111116
{progressBar}
112117
<ContentView
113118
size="small"

PButton.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { View, Text, Button } from 'react-native';
33

44
export default class PButton extends Component {
55
render() {
6-
console.log(this.props);
6+
console.log("this.props.title " + this.props.title + " " + (typeof this.props.title));
77
return (
88
<View style={{flex : 1, padding: 10}}>
99
<Button title={this.props.title} color={this.props.color||'green'} onPress={this.props.onPress}>

package.json

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,39 @@
11
{
2-
"name": "BigList",
2+
"name": "AwesomeProject0697",
33
"version": "0.0.1",
44
"private": true,
55
"scripts": {
66
"android": "react-native run-android",
77
"ios": "react-native run-ios",
88
"start": "react-native start",
99
"test": "jest",
10-
"lint": "eslint ."
10+
"lint": "eslint .",
11+
"postinstall": "patch-package"
1112
},
1213
"dependencies": {
13-
"@react-native-community/art": "^1.2.0",
14-
"@react-native-community/masked-view": "^0.1.10",
15-
"@yoonzm/react-native-alphabet-flat-list": "https://github.com/UseAllFive/react-native-alphabet-flat-list.git",
16-
"react": "16.13.1",
17-
"react-native": "0.63.3",
18-
"react-native-button": "^3.0.1",
19-
"react-native-gesture-handler": "^1.8.0",
14+
"@react-navigation/native": "^6.1.6",
15+
"@react-navigation/native-stack": "^6.9.12",
16+
"@react-navigation/stack": "^6.3.16",
17+
"patch-package": "^6.5.1",
18+
"prop-types": "^15.8.1",
19+
"react": "18.0.0",
20+
"react-native": "0.69.7",
21+
"react-native-gesture-handler": "^2.9.0",
2022
"react-native-local-resource": "^0.1.6",
21-
"react-native-progress": "^4.1.2",
22-
"react-native-safe-area-context": "^3.1.8",
23-
"react-native-screens": "^2.12.0",
24-
"react-navigation": "^4.4.3",
25-
"react-navigation-stack": "^2.10.0",
26-
"styled-components": "^5.2.1"
23+
"react-native-root-toast": "^3.4.1",
24+
"react-native-safe-area-context": "^4.5.1",
25+
"react-native-screens": "^3.20.0",
26+
"styled-components": "^5.3.9"
2727
},
2828
"devDependencies": {
29-
"@babel/core": "^7.8.4",
30-
"@babel/runtime": "^7.8.4",
31-
"@react-native-community/eslint-config": "^1.1.0",
32-
"babel-jest": "^25.1.0",
33-
"babel-plugin-transform-remove-console": "^6.9.4",
34-
"eslint": "^6.5.1",
35-
"jest": "^25.1.0",
36-
"metro-react-native-babel-preset": "^0.59.0",
37-
"react-test-renderer": "16.13.1"
29+
"@babel/core": "^7.12.9",
30+
"@babel/runtime": "^7.12.5",
31+
"@react-native-community/eslint-config": "^2.0.0",
32+
"babel-jest": "^26.6.3",
33+
"eslint": "^7.32.0",
34+
"jest": "^26.6.3",
35+
"metro-react-native-babel-preset": "^0.70.3",
36+
"react-test-renderer": "18.0.0"
3837
},
3938
"jest": {
4039
"preset": "react-native"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/node_modules/react-native-local-resource/android/build.gradle b/node_modules/react-native-local-resource/android/build.gradle
2+
index ae0b6dc..24520a2 100644
3+
--- a/node_modules/react-native-local-resource/android/build.gradle
4+
+++ b/node_modules/react-native-local-resource/android/build.gradle
5+
@@ -36,6 +36,6 @@ repositories {
6+
}
7+
8+
dependencies {
9+
- provided 'com.facebook.react:react-native:+'
10+
- compile group: 'commons-io', name: 'commons-io', version: '2.6'
11+
+ compileOnly 'com.facebook.react:react-native:+'
12+
+ implementation group: 'commons-io', name: 'commons-io', version: '2.6'
13+
}

0 commit comments

Comments
 (0)