Giter Site home page Giter Site logo

square's Introduction

React Tic Tac Toe

Tic-tac-toe

Webpack - using jsx requires changes to webpack.config.js

Webpack doesnt know to resolve .jsx files implicitly. You can include .jsx in the extensions that webpack should resolve without explicit declaration.

resolve: { extensions: ['.js', '.jsx'] }

script commands

npm run build -- hotfix loading npm start -- will host at localhost:3010

Immutability is important

The main benefit of immutability is that it helps you build pure components in React. Immutable data can easily determine if changes have been made, which helps to determine when a component requires re-rendering.

Function component

In React, function components are a simpler way to write components that only contain a render method and don’t have their own state. Instead of defining a class which extends React.Component, we can write a function that takes props as input and returns what should be rendered. Function components are less tedious to write than classes, and many components can be expressed this way.

Wrapping upCongratulations! You’ve created a tic-tac-toe game that:

  1. Lets you play tic-tac-toe,
  2. Indicates when a player has won the game,
  3. Stores a game’s history as a game progresses,
  4. Allows players to review a game’s history and see previous versions of a game’s board.

square's People

Watchers

 avatar

square's Issues

同学,您这个项目引入了608个开源组件,存在4个漏洞,辛苦升级一下

检测到 simple-sifu/square 一共引入了608个开源组件,存在4个漏洞

漏洞标题:npm path-parse 安全漏洞
缺陷组件:[email protected]
漏洞编号:CVE-2021-23343
漏洞描述:npm path-parse是美国npm公司的一个应用插件。提供一个路径解析功能。
path-parse 存在安全漏洞,该漏洞源于受到通过splitDeviceRe、splitTailRe和splitPathRe正则表达式的正则表达式拒绝服务(ReDoS)的攻击。
影响范围:(∞, 1.0.7)
最小修复版本:1.0.7
缺陷组件引入路径:[email protected]>@babel/[email protected]>[email protected]>@babel/[email protected]>[email protected]>[email protected]
[email protected]>@babel/[email protected]>[email protected]>@babel/[email protected]>[email protected]>[email protected]
[email protected]>[email protected]>[email protected]>[email protected]>[email protected]
[email protected]>@babel/[email protected]>[email protected]>@babel/[email protected]>[email protected]>[email protected]

另外还有4个漏洞,详细报告:https://mofeisec.com/jr?p=ad95a1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.