All Projects β†’ unfold β†’ React Firebase

unfold / React Firebase

React bindings for Firebase

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Firebase

Unity Solutions
Use Firebase tools to incorporate common features into your games!
Stars: ✭ 95 (-8.65%)
Mutual labels:  firebase
Conference Hall
πŸ“£ An open SaaS platform to manage call for papers
Stars: ✭ 97 (-6.73%)
Mutual labels:  firebase
Feedfire
FeedFire is a project to help developers integrate with Google Firebase.
Stars: ✭ 100 (-3.85%)
Mutual labels:  firebase
Admob For Flash
admob ane for flash air iOS app and actionscript android app.include banner and Interstitial native Advertising.this Admob ANE suport admob 1 and admob 2,based on firebase sdk
Stars: ✭ 95 (-8.65%)
Mutual labels:  firebase
Whereareyou
Real time location tracker using Android App & Firebase with Mapbox
Stars: ✭ 96 (-7.69%)
Mutual labels:  firebase
Delern
Spaced repetition learning system
Stars: ✭ 98 (-5.77%)
Mutual labels:  firebase
Robot Scouter
πŸ€– Easy, efficient, and collaborative FIRST robot scouting
Stars: ✭ 94 (-9.62%)
Mutual labels:  firebase
Pring.ts
Cloud Firestore model framework for TypeScript - Google
Stars: ✭ 103 (-0.96%)
Mutual labels:  firebase
Flagged
Feature Flags for React made easy with hooks, HOC and Render Props
Stars: ✭ 97 (-6.73%)
Mutual labels:  higher-order-component
Fireway
A schema migration tool for firestore
Stars: ✭ 100 (-3.85%)
Mutual labels:  firebase
Gatsby Theme Firebase
πŸ”₯ A Gatsby Theme for adding Firebase to your application.
Stars: ✭ 96 (-7.69%)
Mutual labels:  firebase
Searchitem
ε°ζœζœβ€”β€”ε•†ε“ζ‘ε½’η οΌδΊŒη»΄η ζœη΄’APP
Stars: ✭ 96 (-7.69%)
Mutual labels:  firebase
Firebase
[DEPRECATED] Unofficial Carthage support for Firebase libraries
Stars: ✭ 99 (-4.81%)
Mutual labels:  firebase
Firebaseim
Android chat app to demo the use of Firebase Cloud Functions
Stars: ✭ 95 (-8.65%)
Mutual labels:  firebase
Flutter medical
Functioning Doctor/Healthcare Catalog App created using Dart with Flutter. Stores and loads data from Firebase Firestore DB.
Stars: ✭ 99 (-4.81%)
Mutual labels:  firebase
Flutter todo
Yet another Todo app, now using Flutter (with ScopedModel)
Stars: ✭ 94 (-9.62%)
Mutual labels:  firebase
Dashboards
Drag & drop dashboard builder!
Stars: ✭ 97 (-6.73%)
Mutual labels:  firebase
Ionic Messenger Starter
@ionic/angular, angularfire2, firebase 5 messenger starter.
Stars: ✭ 103 (-0.96%)
Mutual labels:  firebase
Nuxt Firebase Pwa
Run the Nuxt.js application (SPA * SSR * PWA) on Firebase.
Stars: ✭ 103 (-0.96%)
Mutual labels:  firebase
React Sortable Hoc
A set of higher-order components to turn any list into an animated, accessible and touch-friendly sortable list✌️
Stars: ✭ 9,747 (+9272.12%)
Mutual labels:  higher-order-component

React Firebase

React bindings for Firebase.

⚠️ React Firebase in not maintained anymore

There might come a replacement from React itself with Suspense, but when is not certain. If you want to contribute or maintain this project, send a message to @einarlove.

Installation

npm install --save react-firebase

React Firebase requires React 0.14 and Firebase 3 or later.

Example

import React from 'react'
import firebase from 'firebase'
import { connect } from 'react-firebase'

firebase.initializeApp({
  databaseURL: 'https://react-firebase-sandbox.firebaseio.com'
})

const Counter = ({ value, setValue }) => (
  <div>
    <button onClick={() => setValue(value - 1)}>-</button>
    <span>{value}</span>
    <button onClick={() => setValue(value + 1)}>+</button>
  </div>
)

export default connect((props, ref) => ({
  value: 'counterValue',
  setValue: value => ref('counterValue').set(value)
}))(Counter)

Test for yourself on Codepen.io

Usage

connect([mapFirebaseToProps], [mergeProps])

Connects a React component to a Firebase App reference.

It does not modify the component class passed to it. Instead, it returns a new, connected component class, for you to use.

Arguments

  • [mapFirebaseToProps(props, ref, firebaseApp): subscriptions] (Object or Function): Its result, or the argument itself must be a plain object. Each value must either be a path to a location in your database, a query object or a function. If you omit it, the default implementation just passes firebaseApp as a prop to your component.

  • [mergeProps(ownProps, firebaseProps): props] (Function): If specified, it is passed the parent props and current subscription state merged with the result of mapFirebaseToProps(). The plain object you return from it will be passed as props to the wrapped component. If you omit it, Object.assign({}, ownProps, firebaseProps) is used by default.

Returns

A React component class that passes subscriptions and actions as props to your component according to the specified options.

Note: "actions" are any function values returned by mapFirebaseToProps() which are typically used to modify data in Firebase.

Static Properties
  • WrappedComponent (Component): The original component class passed to connect().
Pass todos as a prop

Note: The value of todos is the path to your data in Firebase. This is equivalent to firebase.database().ref('todo').

const mapFirebaseToProps = {
  todos: 'todos'
}

export default connect(mapFirebaseToProps)(TodoApp)
Pass todos and a function that adds a new todo (addTodo) as props
const mapFirebaseToProps = (props, ref) => ({
  todos: 'todos',
  addTodo: todo => ref('todos').push(todo)
})

export default connect(mapFirebaseToProps)(TodoApp)
Pass todos, completedTodos, a function that completes a todo (completeTodo) and one that logs in as props
const mapFirebaseToProps = (props, ref, firebase) => ({
  todos: 'todos',
  completedTodos: {
    path: 'todos',
    orderByChild: 'completed',
    equalTo: true
  },
  completeTodo = id => ref(`todos/${id}/completed`).set(true),
  login: (email, password) => firebase.auth().signInWithEmailAndPassword(email, password)
})

export default connect(mapFirebaseToProps)(TodoApp)

<Provider firebaseApp>

By default connect() will use the default Firebase App. If you have multiple Firebase App references in your application you may use this to specify the Firebase App reference available to connect() calls in the component hierarchy below.

If you really need to, you can manually pass firebaseApp as a prop to every connect()ed component, but we only recommend to do this for stubbing firebaseApp in unit tests, or in non-fully-React codebases. Normally, you should just use <Provider>.

Props

  • firebaseApp (App): A Firebase App reference.
  • children (ReactElement): The root of your component hierarchy.

Example

import { Provider } from 'react-firebase'
import { initializeApp } from 'firebase'

const firebaseApp = initializeApp({
  databaseURL: 'https://my-firebase.firebaseio.com'
})

ReactDOM.render(
  <Provider firebaseApp={firebaseApp}>
    <MyRootComponent />
  </Provider>,
  rootEl
)

License

MIT

Acknowledgements

react-redux which this library is heavily inspired by.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].