Socket
Socket
Sign inDemoInstall

react-feathersjs

Package Overview
Dependencies
5
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-feathersjs

React bindings for FeatherJS


Version published
Maintainers
1
Created

Readme

Source

React-FeathersJS

This library offers a simple way to to connect your React application to your FeathersJS back-end. The library is isomorphic by nature so it's easy to use with both React and React Native.

Usage

Install the package:

yarn add react-feathersjs

or

npm i --save react-feathersjs

Then wrap your App in the FeathersWrapper component:

import React from 'react';
import { render } from 'react-dom';
import { FeathersProvider } from 'react-feathersjs';
import App from './src';

render(
  <FeathersProvider>
    <App>
  </FeathersProvider>,
  document.getElementById('app')
);

Then in your app:

// in src/App.js
import React from 'react';
import { connectFeathers } from 'react-feathersjs';

function App({ feathers }) {
  console.log(feathers); // feathers client object is available for use!
  return (
    <div>
      <h1>I love FeathersJS!</h1>
    </div>
  );
}

export default connectFeathers(App);

API

FeathersProvider

See /src/types.js for the props provided. Essentially what this does though is connect to a feathers back-end and then pass the feathers object through context to it's children.

connectFeathers

A HOF that accepts a wrapped component as it's first parameter and an options object as it's second parameter. Currently, the only key in the options object is withRef which provides a ref for the wrapped component (this option is false by default). If you need to access the wrapped component then use the method getWrappedInstance().

Future Development

Right now the library connects to your FeathersJS back-end through socket-io. In the future, I'd like to give the option to connect to a rest only back-end. I'd also like to rewrite the library in typescript. Help is always welcome :smile:

Keywords

FAQs

Last updated on 25 May 2018

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc