@tstris/react
v0.2.1
Published
Binding for react to make using tstris easier.
Downloads
3
Maintainers
Readme
tstris-react
Bindings for tstris through react hooks.
Installation
npm install @tstris/core @tstris/react
Usage
import { useTstris } from '@tstris/react';
const Component = () => {
const { boardWPlayer, moveHandler } = useTstris();
return (
<Board onKeyDown={moveHandler} board={boardWPlayer} />
);
}
This is a very dumbed down example, please look at examples/react for a more detailed implementation.