@tstris/react
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published

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.

Package Sidebar

Install

npm i @tstris/react

Weekly Downloads

2

Version

0.2.1

License

MIT

Unpacked Size

18 kB

Total Files

7

Last publish

Collaborators

  • igamble