0.2.1 • Published 3 years ago

@tstris/react v0.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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.