Skip to content

Latest commit

 

History

History
33 lines (27 loc) · 722 Bytes

README.md

File metadata and controls

33 lines (27 loc) · 722 Bytes

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