Releases: mbasso/react-wasm
Releases · mbasso/react-wasm
useWasm Hook
Features
add useWasm
Hook 🎉
import { useWasm } from "react-wasm";
// supposing an "add.wasm" module that exports a single function "add"
const ExampleComponent = () => {
const {
loading,
error,
data
} = useWasm({
url: '/add.wasm'
});
if (loading) return "Loading...";
if (error) return "An error has occurred";
const { module, instance } = data;
return <div>1 + 2 = {instance.exports.add(1, 2)}</div>;
};
Breaking changes
- react-wasm now needs
react@^16.8.0
- dropped
node@9
support
withWasm HoC
First release🎉
0.1.2