All Projects → PlatziDev → socket.io-react

PlatziDev / socket.io-react

Licence: other
A High-Order component to connect React and Socket.io easily

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to socket.io-react

Socket Controllers
Use class-based controllers to handle websocket events.
Stars: ✭ 191 (+185.07%)
Mutual labels:  socket, socket-io, decorators
Node Decorators
node-decorators
Stars: ✭ 230 (+243.28%)
Mutual labels:  socket, socket-io, decorators
Socket.io Redux
Redux middleware to emit action via socket.io
Stars: ✭ 103 (+53.73%)
Mutual labels:  socket, socket-io
Rltm.js
Easily swap realtime providers with a single code base
Stars: ✭ 106 (+58.21%)
Mutual labels:  socket, socket-io
Nuxt Socket Io
Nuxt Socket IO - socket.io client and server module for Nuxt
Stars: ✭ 148 (+120.9%)
Mutual labels:  socket, socket-io
Progress Bot
High-tech weaponized moe progress delivery bot for IRC, Discord, and web
Stars: ✭ 38 (-43.28%)
Mutual labels:  socket, socket-io
Chatter
A chatting app using socket.io
Stars: ✭ 53 (-20.9%)
Mutual labels:  socket, socket-io
Sample Chat Electron
Socket.io based chat server and clients, implemented in NodeJS and distributed to Windows and MacOS.
Stars: ✭ 116 (+73.13%)
Mutual labels:  socket, socket-io
Bizsocket
异步socket,对一些业务场景做了支持
Stars: ✭ 469 (+600%)
Mutual labels:  socket, socket-io
Vuesocial
something like QQ、weibo、weChat(vue+express+socket.io仿微博、微信的聊天社交平台)
Stars: ✭ 189 (+182.09%)
Mutual labels:  socket, socket-io
Oksocket
An blocking socket client for Android applications.
Stars: ✭ 2,359 (+3420.9%)
Mutual labels:  socket, socket-io
Peeplus
python+vue3前后端分离项目
Stars: ✭ 28 (-58.21%)
Mutual labels:  socket, socket-io
Dodgem
A Simple Multiplayer Game, built with Mage Game Engine.
Stars: ✭ 12 (-82.09%)
Mutual labels:  socket, socket-io
Socket.io Rpc
Extend your promises across a network with socket.io
Stars: ✭ 67 (+0%)
Mutual labels:  socket, socket-io
Angular Contacts App Example
Full Stack Angular PWA example app with NgRx & NestJS
Stars: ✭ 570 (+750.75%)
Mutual labels:  socket, socket-io
Graphql Live Query
Realtime GraphQL Live Queries with JavaScript
Stars: ✭ 112 (+67.16%)
Mutual labels:  socket, socket-io
socket-chat
This project will help you build a chat app by using the Socket IO library.
Stars: ✭ 36 (-46.27%)
Mutual labels:  socket, socket-io
Socket.io
NodeJS《你画我猜》游戏
Stars: ✭ 255 (+280.6%)
Mutual labels:  socket, socket-io
Ngx Socket Io
Socket.IO module for Angular
Stars: ✭ 178 (+165.67%)
Mutual labels:  socket, socket-io
Web Socket
Laravel library for asynchronously serving WebSockets.
Stars: ✭ 225 (+235.82%)
Mutual labels:  socket, socket-io

socket.io-react

A High-Order component to connect React and Socket.io easily.

API

import {
  SocketProvider,
  socketConnect,
} from 'socket.io-react';

SocketProvider(socket?)

import { SocketProvider } from 'socket.io-react';
import io from 'socket.io-client';

import App from './containers/App';

const socket = io.connect(process.env.SOCKET_URL);
socket.on('message', msg => console.log(msg));

const DOMNode = document.getElementById('renderTarget');

render(
  <SocketProvider socket={socket}>
    <App />
  </SocketProvider>,
  DOMNode
);
  • socket property is false by default.

socketConnect(Target)

import { socketConnect } from 'socket.io-react';

function App(props) {
  function sendMessage() {
    props.socket.emit('message', 'Hello world!');
  }

  return (
    <button onClick={sendMessage}>
      Send!
    </button>
  );
}

export default socketConnect(App);
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].