Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-meteor

Package Overview
Dependencies
Maintainers
3
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-meteor

Full Meteor Client for React Native

  • 1.4.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
15
increased by50%
Maintainers
3
Weekly downloads
 
Created
Source

react-native-meteor

react-native-meteor npm version Dependency Status

Meteor-like methods for React Native.

If you have questions, you can open a new issue in the repository or ask in the our Gitter chat:
https://gitter.im/react-native-meteor/Lobby

What is it for ?

The purpose of this library is :

  • To set up and maintain a ddp connection with a ddp server, freeing the developer from having to do it on their own.
  • Be fully compatible with react-native and help react-native developers.
  • To match with Meteor documentation used with React.

Install

yarn add react-native-meteor

or

npm i --save react-native-meteor

!! See detailed installation guide

Compatibility notes

Since RN 0.26.0 you have to use ws or wss protocol to connect to your meteor server. http is not working on Android.

It is recommended to always use the latest version of react-native-meteor compatible with your RN version:

  • For RN > 0.49, use react-native-meteor@latest
  • For RN > 0.45, use react-native-meteor@1.1.x
  • For RN = 0.45, use react-native-meteor@1.0.6
  • For RN < 0.45, you can use version react-native-meteor@1.0.3 in case or problems.

Example usage

import React, { Component } from 'react';
import { View, Text } from 'react-native';
import Meteor, { withTracker, MeteorListView } from 'react-native-meteor';

Meteor.connect('ws://192.168.X.X:3000/websocket'); //do this only once

class App extends Component {
  renderRow(todo) {
    return <Text>{todo.title}</Text>;
  }
  render() {
    const { settings, todosReady } = this.props;

    return (
      <View>
        <Text>{settings.title}</Text>
        {!todosReady && <Text>Not ready</Text>}

        <MeteorListView
          collection="todos"
          selector={{ done: true }}
          options={{ sort: { createdAt: -1 } }}
          renderRow={this.renderRow}
        />
      </View>
    );
  }
}

export default withTracker(params => {
  const handle = Meteor.subscribe('todos');
  Meteor.subscribe('settings');

  return {
    todosReady: handle.ready(),
    settings: Meteor.collection('settings').findOne(),
  };
})(App);

Documentation

Author

image

Want to help ?

Pull Requests and issues reported are welcome! :)

License

react-native-meteor is MIT Licensed.

Keywords

FAQs

Package last updated on 09 Jul 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc