New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@electric-sql/react

Package Overview
Dependencies
Maintainers
4
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@electric-sql/react

React hooks for ElectricSQL

latest
Source
npmnpm
Version
1.0.43
Version published
Weekly downloads
21K
16.84%
Maintainers
4
Weekly downloads
 
Created
Source

React integration for ElectricSQL

Electric is Postgres sync for modern apps.

Electric provides an HTTP interface to Postgres to enable massive number of clients to query and get real-time updates to data in "shapes" i.e. subsets of the database. Electric turns Postgres into a real-time database.

This packages exposes a useShape hook for pulling shape data into your React components.

Shapes and ShapeStreams instances are cached globally so re-using shapes in multiple components is cheap.

Install

npm i @electric-sql/react

How to use

Add useShape to a component

import { useShape } from '@electric-sql/react'

export default function MyComponent() {
  const { isLoading, data } = useShape({
    url: 'http://my-api.com/shape',
    params: {
      table: `foo`,
    },
  })

  if (isLoading) {
    return <div>loading</div>
  }

  return (
    <div>
      {data.map((foo) => (
        <div>{foo.title}</div>
      ))}
    </div>
  )
}

FAQs

Package last updated on 31 Mar 2026

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