Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All fixes for NetInfo fix plus AsyncStorage #359

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion example/RNApp/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import EditItemContainer from './containers/editItem';

export default class RNApp extends Component {

componentWillMount() {
UNSAFE_componentWillMount() {
connect();
}

Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
},
"peerDependencies": {
"react": "*",
"react-native": ">= 0.49.0"
"react-native": ">= 0.49.0",
"@react-native-community/async-storage": "*"
}
}
}
2 changes: 1 addition & 1 deletion src/CollectionFS/FSCollectionImagesPreloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default class FSCollectionImagesPreloader extends Component {
items: [],
};
}
componentWillMount() {
UNSAFE_componentWillMount() {
const { collection, selector } = this.props;

this.update = results => {
Expand Down
3 changes: 2 additions & 1 deletion src/Meteor.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
4 changes: 2 additions & 2 deletions src/components/ComplexListView.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ export default class MeteorListView extends Component {
}),
};
}
componentWillReceiveProps(props) {
UNSAFE_componentWillReceiveProps(props) {
const { elements } = props;

const elems = elements();
this.setState({
ds: this.state.ds.cloneWithRows(elems),
});
}
componentWillMount() {
UNSAFE_componentWillMount() {
const { elements } = this.props;

this.onChange = () => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/ListView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down
8 changes: 4 additions & 4 deletions src/components/ReactMeteorData.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Data from '../Data';
import MeteorDataManager from './MeteorDataManager';

const ReactMeteorData = {
componentWillMount() {
UNSAFE_componentWillMount() {
Data.waitDdpReady(() => {
if (this.getMeteorData) {
this.data = {};
Expand All @@ -16,7 +16,7 @@ const ReactMeteorData = {
});
},

componentWillUpdate(nextProps, nextState) {
UNSAFE_componentWillUpdate(nextProps, nextState) {
if (this.startMeteorSubscriptions) {
if (
!EJSON.equals(this.state, nextState) ||
Expand Down Expand Up @@ -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 <WrappedComponent {...this.props} {...this.data} />;
}
};
});
}
2 changes: 1 addition & 1 deletion src/user/User.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down