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

@polybase/react

Package Overview
Dependencies
Maintainers
3
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@polybase/react

React wrapper for @polybase/client

latest
npmnpm
Version
0.6.6
Version published
Weekly downloads
34
-63.44%
Maintainers
3
Weekly downloads
 
Created
Source

Polybase React

React wrapper for @polybase/client.

Install Polybase

npm install @polybase/react
yarn add @polybase/react

Add Polybase Provider

import * as React from 'react'
import { PolybaseProvider } from '@polybase/react'
import { Polybase } from '@polybase/client/web'

const polybase = new Polybase()

export const App = () => {
  return (
    <PolybaseProvider polybase={polybase}>
      {/* ... your app routes */}
    </PolybaseProvider>
  )
}

Read a record (with updates)

import * as React from 'react'
import { usePolybase, useRecord } from '@polybase/react'

export const Component = () => {
  const polybase = usePolybase()
  const { data, error, loading } = useRecord<OptionalCustomType>(polybase.collection('users').record('id'))

  return data.data.name
}

List collection records (with updates)

import * as React from 'react'
import { usePolybase, useCollection } from '@polybase/react'

export const Component = () => {
  const polybase = usePolybase()
  const { data, error, loading } = useCollection<OptionalCustomType>(polybase.collection('users'))

  const usersEl = map(data, ({ data }) => {
    return (
      <div key={data.id}>
        {data.name}
      </div>
    )
  })

  return usersEl
}

FAQs

Package last updated on 23 Aug 2023

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