Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kubohiroya/react-webgpu-context
React context and hook to use WebGPU
https://github.com/kubohiroya/react-webgpu-context
Last synced: 16 days ago
JSON representation
React context and hook to use WebGPU
- Host: GitHub
- URL: https://github.com/kubohiroya/react-webgpu-context
- Owner: kubohiroya
- License: mit
- Created: 2024-12-26T01:06:38.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-12-26T01:43:47.000Z (about 1 month ago)
- Last Synced: 2024-12-26T01:44:41.759Z (about 1 month ago)
- Language: JavaScript
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# react-webgpu-context
React context and hook to use WebGPU with customizable loading and not supported messages.## Installation
```bash
pnpm install react-webgpu-context
```### App.tsx
```tsx
import { WebGPUDeviceContextProvider } from 'react-webgpu-context';
import {MyWebGPUApp} from './MyWebGpuApp'
export const App = ()=>{
return (
Loading...)}
notSupportedMessage={(WebGPU is not supported on this browser.
)}>
);
}
```### MyWebGpuApp.tsx
```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](https://github.com/kubohiroya)
## License
MIT