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 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/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/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/Meteor.js b/src/Meteor.js index 20be280..50c3f23 100644 --- a/src/Meteor.js +++ b/src/Meteor.js @@ -1,4 +1,5 @@ -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'; import Trackr from 'trackr'; 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 ; } - }; + }); } 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';