Giter Site home page Giter Site logo

hero-skills's Introduction

hero-skills

It is a little demo about modifying point skill of heroes.

Used Packages

React: JS Framework

TypeScript: It's s a syntactic superset of JavaScript which adds static typing.

Styled-Components: It allows you to write actual CSS code to style your components. It also removes the mapping between components and styles โ€“ using components as a low-level styling construct could not be easier!

Eslint: It can define rules to keep code style consistent and help me find and fix problems with your JavaScript code.

Prettier: It is an opinionated code formatter that supports a lot of different programming languages, like: JavaScript. JSON. JSX. CSS.

Axios: Axios is a promised-based HTTP client for JavaScript. It has the ability to make HTTP requests from the browser and handle the transformation of request and response data.

React Router DOM: It enables you to implement dynamic routing in a web app. Unlike the traditional routing architecture in which the routing is handled in a configuration outside a running app, React Router DOM facilitates component-based routing according to the needs of the app and platform.

Comment Principle

Only comment things e.g. // TODO if the code is uncompleted or will be used in the future.

Obstacles to overcome

First time using styled-component, figuring out the art of decomposing components in the most efficient way took me some time, but I eventually did it by observing common factors and extracting them out along the way.

Folder Structure

  • /src/api - axios Instance and APIs

  • /src/components - reusable components

  • /src/const - constant data for initializing or dummy data

  • /src/pages - page components

  • /src/types - types used in the project

Performance Optimization

  1. Using React.memo to avoid re-rendering of HeroCard unless props active changes.
  2. Using Suspense and React.lazy for code-splitting.

Install Dependencies

yarn

Start Project

yarn dev

then go to http://127.0.0.1:5173/

hero-skills's People

Contributors

ruila avatar nextdrive-williamlin avatar

Watchers

 avatar

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.