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

react-webgpu-context

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-webgpu-context

React context and hook to use WebGPU

latest
Source
npmnpm
Version
0.1.2
Version published
Weekly downloads
1
-50%
Maintainers
0
Weekly downloads
 
Created
Source

react-webgpu-context

React context and hook to use WebGPU with customizable loading and not supported messages.

Installation

  pnpm install react-webgpu-context

App.tsx

import { WebGPUDeviceContextProvider } from 'react-webgpu-context';
import {MyWebGPUApp} from './MyWebGpuApp'
export const App = ()=>{
  return (
    <WebGPUDeviceContextProvider
      loadingMessage={(<p>Loading...</p>)}
      notSupportedMessage={(<p>WebGPU is not supported on this browser.</p>)}>
      <MyWebGPUApp />
    </WebGPUDeviceContextProvider>
  );
}

MyWebGpuApp.tsx

import { useWebGPUDevice } from 'react-webgpu-context';

export const MyWebGPUApp = ()=>{
  const device: GPUDevice = useWebGPUDevice();
  // use device to create render pipeline, buffers, etc.
}

Author

  • Hiroya Kubo

License

MIT

Keywords

React

FAQs

Package last updated on 26 Dec 2024

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