Skip to content

huaying/tetris

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Tetris Component

Install

npm install @huaying/tetris --save
// or
yarn add @huaying/tetris

Usage

import React from "react";
import Tetris from "@huaying/tetris";

const App = () => (
  <Tetris>
    {gameStart => (
      <div className="info">
        <span className="title"> Tetris </span>
        <span className="start" onClick={gameStart}>
          Start
        </span>
      </div>
    )}
  </Tetris>
);

export default App;

Screen Shot 2019-11-16 at 1 07 07 AM

Play Tetris on Codesandbox