From 16c9cabf4bc5829b16ed0b35196b470356657b06 Mon Sep 17 00:00:00 2001 From: Darren Labrum Date: Wed, 2 Oct 2019 19:33:54 -0600 Subject: [PATCH 1/5] NetInfo Fix --- src/Meteor.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Meteor.js b/src/Meteor.js index 20be280..86f3d0e 100644 --- a/src/Meteor.js +++ b/src/Meteor.js @@ -1,4 +1,5 @@ import { NetInfo, Platform, View } from 'react-native'; +import NetInfo from '@react-native-community/netinfo'; import reactMixin from 'react-mixin'; import Trackr from 'trackr'; From e7ab8b64f07618700358ad4ebb1a4b877aed0544 Mon Sep 17 00:00:00 2001 From: Darren Labrum Date: Wed, 2 Oct 2019 19:37:07 -0600 Subject: [PATCH 2/5] Update Meteor.js --- src/Meteor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Meteor.js b/src/Meteor.js index 86f3d0e..50c3f23 100644 --- a/src/Meteor.js +++ b/src/Meteor.js @@ -1,4 +1,4 @@ -import { NetInfo, Platform, View } from 'react-native'; +import { Platform, View } from 'react-native'; import NetInfo from '@react-native-community/netinfo'; import reactMixin from 'react-mixin'; From 4600ceaca6c705450a5dde3d8102cd3e1f171da0 Mon Sep 17 00:00:00 2001 From: Preeternal Date: Sun, 1 Dec 2019 16:59:07 +0200 Subject: [PATCH 3/5] In React 17.x, only the UNSAFE_ name will work --- example/RNApp/app/index.js | 2 +- src/CollectionFS/FSCollectionImagesPreloader.js | 2 +- src/components/ComplexListView.js | 4 ++-- src/components/ListView.js | 4 ++-- src/components/ReactMeteorData.js | 8 ++++---- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/example/RNApp/app/index.js b/example/RNApp/app/index.js index 3cfcd17..79407ba 100644 --- a/example/RNApp/app/index.js +++ b/example/RNApp/app/index.js @@ -13,7 +13,7 @@ import EditItemContainer from './containers/editItem'; export default class RNApp extends Component { - componentWillMount() { + UNSAFE_componentWillMount() { connect(); } diff --git a/src/CollectionFS/FSCollectionImagesPreloader.js b/src/CollectionFS/FSCollectionImagesPreloader.js index 98d75e4..6d8f79b 100644 --- a/src/CollectionFS/FSCollectionImagesPreloader.js +++ b/src/CollectionFS/FSCollectionImagesPreloader.js @@ -21,7 +21,7 @@ export default class FSCollectionImagesPreloader extends Component { items: [], }; } - componentWillMount() { + UNSAFE_componentWillMount() { const { collection, selector } = this.props; this.update = results => { diff --git a/src/components/ComplexListView.js b/src/components/ComplexListView.js index 9afecad..b0b1c40 100644 --- a/src/components/ComplexListView.js +++ b/src/components/ComplexListView.js @@ -21,7 +21,7 @@ export default class MeteorListView extends Component { }), }; } - componentWillReceiveProps(props) { + UNSAFE_componentWillReceiveProps(props) { const { elements } = props; const elems = elements(); @@ -29,7 +29,7 @@ export default class MeteorListView extends Component { ds: this.state.ds.cloneWithRows(elems), }); } - componentWillMount() { + UNSAFE_componentWillMount() { const { elements } = this.props; this.onChange = () => { diff --git a/src/components/ListView.js b/src/components/ListView.js index 43df6c5..863e0fe 100644 --- a/src/components/ListView.js +++ b/src/components/ListView.js @@ -26,12 +26,12 @@ export default class MeteorListView extends Component { }), }; } - componentWillReceiveProps(props) { + UNSAFE_componentWillReceiveProps(props) { const { collection, selector, options } = props; this.update(Data.db[collection].find(selector, options)); } - componentWillMount() { + UNSAFE_componentWillMount() { const { collection, selector, options } = this.props; this.update = results => { diff --git a/src/components/ReactMeteorData.js b/src/components/ReactMeteorData.js index d352ead..cb59605 100644 --- a/src/components/ReactMeteorData.js +++ b/src/components/ReactMeteorData.js @@ -5,7 +5,7 @@ import Data from '../Data'; import MeteorDataManager from './MeteorDataManager'; const ReactMeteorData = { - componentWillMount() { + UNSAFE_componentWillMount() { Data.waitDdpReady(() => { if (this.getMeteorData) { this.data = {}; @@ -16,7 +16,7 @@ const ReactMeteorData = { }); }, - componentWillUpdate(nextProps, nextState) { + UNSAFE_componentWillUpdate(nextProps, nextState) { if (this.startMeteorSubscriptions) { if ( !EJSON.equals(this.state, nextState) || @@ -80,12 +80,12 @@ export default function connect(options) { const BaseComponent = pure ? ReactPureComponent : ReactComponent; return WrappedComponent => - class ReactMeteorDataComponent extends BaseComponent { + (class ReactMeteorDataComponent extends BaseComponent { getMeteorData() { return getMeteorData(this.props); } render() { return ; } - }; + }); } From 62ea7f7a1293eb7f98b35a5bb8168a119c7d8425 Mon Sep 17 00:00:00 2001 From: Preeternal Date: Mon, 2 Dec 2019 19:52:50 +0200 Subject: [PATCH 4/5] @react-native-community/async-storage --- package.json | 5 +++-- src/user/User.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index e5e8fa3..710d2d7 100644 --- a/package.json +++ b/package.json @@ -57,6 +57,7 @@ }, "peerDependencies": { "react": "*", - "react-native": ">= 0.49.0" + "react-native": ">= 0.49.0", + "@react-native-community/async-storage": "*" } -} +} \ No newline at end of file diff --git a/src/user/User.js b/src/user/User.js index 86fd1c9..fbd76a3 100644 --- a/src/user/User.js +++ b/src/user/User.js @@ -1,4 +1,4 @@ -import { AsyncStorage } from 'react-native'; +import AsyncStorage from '@react-native-community/async-storage'; import Data from '../Data'; import { hashPassword } from '../../lib/utils'; From a9d47a5f4e04514de5fc5b3f67c1d58c8988d5d5 Mon Sep 17 00:00:00 2001 From: Preeternal Date: Mon, 2 Dec 2019 20:02:43 +0200 Subject: [PATCH 5/5] update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bfc9ab9..1df4ec6 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ The purpose of this library is : ## Install ``` -yarn add react-native-meteor +yarn add react-native-meteor @react-native-community/async-storage ``` or